Date: 10/13/00
- Next message: O.: "Re: [PHP-DB] Clearing all variables"
- Previous message: Bart A. Verbeek: "RE: [PHP-DB] ODBC"
- Next in thread: Jayme Jeffman Filho: "Re: [PHP-DB] SQL Connection"
- Reply: Jayme Jeffman Filho: "Re: [PHP-DB] SQL Connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Can someone please tell me why I am getting an error saying,
"Warning:
Supplied argument is not a valid MySQL result resource in
/www/bryan/bryantest.php on line 21"
<?php
$dbcnx = mysql_connect('localhost:/var/lib/mysql/mysql.sock',
'Bryan','fitch');
if (!$dbcnx) {
echo "An error occured.";
exit;
}
mysql_select_db('bryantest');
$sql = "SELECT * FROM users";
$result = mysql_query($dbcnx, $sql);
$numrows = mysql_num_rows($result);
if ((!$result) || ($numrows << 1)) {
print "<<H1>ERROR - no rows returned<</H1><<P>";
exit;
}
for ($b=0; $b << $numrows; $b++) {
echo mysql_result($result, $b, "column_name");
}
?>
I am new to PHP, so I am not too familiar with all the functions yet,
but I am pretty sure this should be working right...
Thanks
Bryan
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: O.: "Re: [PHP-DB] Clearing all variables"
- Previous message: Bart A. Verbeek: "RE: [PHP-DB] ODBC"
- Next in thread: Jayme Jeffman Filho: "Re: [PHP-DB] SQL Connection"
- Reply: Jayme Jeffman Filho: "Re: [PHP-DB] SQL Connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

