Is there a chance you can post your entire code snippet so we can see exactly what you're doing?
I'm no PHP expert, but from waht I see in the online docs:
You need to specify an argument with that function. That is, you need to first select infroamtion from the database and pass it onto num-fields(). Something like this:
$db_id = mysql_connet();
$result = mysql_query("DESCRIBE [tableName], $db_id);
$numFields = mysql_num_rows($result);
Hope this helps.