note 79155 added to function.mysql-field-name
| From: | blackjackdevel at gmail dot com | Date: | Wed, 14 Nov 2007 00:13:05 +0000 |
| Subject: | note 79155 added to function.mysql-field-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132240@lists.php.net to get a copy of this message | ||
Strangely using an aproach like this:
$res=mysql_query("SELECT * FROM
orders",$conec) or die (mysql_error());
$fields = mysql_num_fields($res);
$out="";
for ($i = 0; $i < $fields; $i++) {
$fname=mysql_field_name($res, $i);
}
Outputted the E_Warning:
Warning: mysql_field_name() [function.mysql-field-name]: Field N is invalid for MySQL result index
With a lot of different number at N. But expliciting all fields instead of *. Didn't outputted
the error.
It maybe a caracteristic of this mysql database(it is from a open source application) because i
never saw this in my own databases. Anyway hope this help if someone face the same strange situation
----
Server IP: 200.185.109.13
Probable Submitter: 189.29.139.25
----
Manual Page -- http://www.php.net/manual/en/function.mysql-field-name.php
Edit -- https://master.php.net/note/edit/79155
Del: integrated -- https://master.php.net/note/delete/79155/integrated
Del: useless -- https://master.php.net/note/delete/79155/useless
Del: bad code -- https://master.php.net/note/delete/79155/bad+code
Del: spam -- https://master.php.net/note/delete/79155/spam
Del: non-english -- https://master.php.net/note/delete/79155/non-english
Del: in docs -- https://master.php.net/note/delete/79155/in+docs
Del: other reasons-- https://master.php.net/note/delete/79155
Reject -- https://master.php.net/note/reject/79155
Search -- https://master.php.net/manage/user-notes.php