How to get num of fields in a table?
what do you mean with "fields"? columns or rows or cells?
=>that's column
In MySQL:
$q = 'SHOW COLUMNS FROM my_table'; $rs = mysql_query($q); echo 'column count: ' . mysql_num_rows($rs); while ($r = mysql_fetch_row($rs)) { print_r($r); }