I am stumped and none of my reference manuals are providing much help. I have a script were the default value is used to define how many of an item a user gets when they register on vBulletin.
Previously, I have set this value to a value of "3" with instructions for people that if they wish to change this they can do so by going into phpmyAdmin and updating the default value.
Well, I need to fix this and I have the php code written to UPDATE the default value BUT I can not figure out how to query the field to get the default value in PHP so that I can show this value to the Site Admin so that they can make an informed decision about making an update.
Specifically, my field is in the vBulletin user table and the field is defined as follows when I add the field:
PHP Code:
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "user
ADD `vbclassified_credits` int(5) NOT NULL default '3'");
With the new changes, a site admin can change "default" so I need a way to get this value and allow the Site Admin to see what they have it set to.
I also need this to work on MYSQL 4 or newer as I can not predict what version MYSQL my users may have.
Thanks for any help or advise even if it is a reference to a page or book with general advise.
----------------------------------------
Edit - I am pretty confident the solution has to do with the MYSQL DEFAULT() function, but I am still struggling to figure out how to make it work inside of a PHP Script using the unique vBulletin code to access the database.
http://dev.mysql.com/doc/refman/5.0/...nction_default