[PHP-DB] SQL Connection From: bryan (bryan <email protected>)
Date: 10/13/00

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>