Check if a column exists in a table with MySQL
This works well for me. SHOW COLUMNS FROM `table` LIKE ‘fieldname’; With PHP it would be something like… $result = mysql_query(“SHOW COLUMNS FROM `table` LIKE ‘fieldname'”); $exists = (mysql_num_rows($result))?TRUE:FALSE;