SELECT count(*) FROM information_schema.`COLUMNS` C WHERE table_name = 'your_table_name' AND TABLE_SCHEMA = "your_db_name"
TABLE_SCHEMA is required only if table name exists in more than one db
Hi,
this should help
$myQuery = "show columns from $my_table_name"; $result = mysql_query($myQuery); $row = mysql_fetch_row($result); $columncount = count($row);