how can I determine whether a column exists in a table?
Example: I want to check whether column Topic exist in table Subject. If it does, tha value 1 will be returned, and if not, 0 will be returned.
Untested, but I guess you could try the following:
$result = mysql_query('SELECT Topic FROM Subject'); if (!$result) return 0; else return 1;
hey..it works. thanx
hello.. most of the time, though, when I used the above method, an error will be displayed.
I'm thinking actually of MySql function. i don't know any MySql query function that can check a column in a table. Is there any?