Date: 04/15/01
- Previous message: Sterling Hughes: "Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / TODO-4.1.txt"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: francis <email protected>
Operating system: Win 2000
PHP version: 4.0.4pl1
PHP Bug Type: MySQL related
Bug description: mysql_fetch_object, $row->0 produces parse error
The script:
mysql_pconnect ($dbhost, $dbuser, $dbpass);
$result = mysql_db_query ("database", "select * from tablename");
while ($row = mysql_fetch_object ($result, MYSQL_NUM)) {
echo $row->0;
echo $row->1;
}
mysql_free_result ($result);
Generates the error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' in d:/htdocs/assets/includes/hs~form_functions.php on line 31
The script below works but not for the general case (different column names):
mysql_pconnect ($dbhost, $dbuser, $dbpass);
$result = mysql_db_query ("database", "select * from tablename");
while ($row = mysql_fetch_object ($result, MYSQL_ASSOC)) {
echo $row->columnone;
echo $row->columntwo;
}
mysql_free_result ($result);
-- Edit Bug report at: http://bugs.php.net/?id=10341&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Previous message: Sterling Hughes: "Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / TODO-4.1.txt"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

