1、查看表的结构
show columns from tablename
desc tablename
2、查看表字段是否存在
desc tablename fieldname
3、php判断表的字段是否存在
mysql_connect('localhost', 'root', 'root');
mysql_select_db('demo');
$test = mysql_query('Describe cdb_posts first');
$test = mysql_fetch_array($test);