I have been looking in the PHP manual for a while to find out how to do this. I am trying to read the default values for a column in mysql. For example, I have a table called 'users' and the column is 'updates'. I have told mysql to use a default of 'YES' in the 'updates' column. Is there any way that I can read that 'YES' value out of the table without having to read it from a record in the table?
Thanks in advance for any help on this!
alright there.
What you need is SHOW Columns.
If you've got a table called cats, do
SHOW columns from cats;
and it'll return a result set, one of the columns being the default.