Note that, if you want to get the amount of columns of a
table and you're using the "SHOW COLUMNS FROM
$table" query, you will have to use mysql_num_rows()
instead of mysql_num_fields() on the result. This becomes
logical when thinking about it, because the SHOW COLUMNS
query returns a result with six columns (Field, Type, Null,
Key, Default and Extra) and with a single row for every
column found. If you'd count the number of fields, you'd
always get 6. If you count the number of rows, you'll get
the amount of columns found.
----
Server IP: 194.109.193.76
Probable Submitter: 212.45.52.129 (proxied: unknown)
----
Manual Page -- http://www.php.net/manual/en/function.mysql-num-fields
.php
Edit -- https://master
.php.net/note/edit/74216
Del: integrated -- h
ttps://master.php.net/note/delete/74216/integrated
Del: useless -- http
s://master.php.net/note/delete/74216/useless
Del: bad code -- htt
ps://master.php.net/note/delete/74216/bad+code
Del: spam -- https:/
/master.php.net/note/delete/74216/spam
Del: non-english --
https://master.php.net/note/delete/74216/non-english
Del: in docs -- http
s://master.php.net/note/delete/74216/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/74216
Reject -- https://mast
er.php.net/note/reject/74216
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|