From: [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]