note 10584 added to mysql_fetch_object
| From: | sigma at headquarters dot ca | Date: | Thu, 11 Jan 2001 16:14:57 +0000 |
| Subject: | note 10584 added to mysql_fetch_object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9656@lists.php.net to get a copy of this message | ||
When you use this function without specifing the result_type you get duplicate information. One is
$row->username;
the other is
$row->0;
or what-ever the column number username is.
They give the same information. To avoid this you should always do
mysql_fetch_object($result, MYSQL_ASSOC);
or
mysql_fetch_object($result, MYSQL_NUM);
http://www.php.net/manual/function.mysql-fetch-object.php