I dont understand why this is causing me so much trouble, hopefully someone 
can help. I have a simple PHP script that takes the user id and password 
from a form on a page...here is the php used after submitting the form:

<?
@ $db = mysql_pconnect("localhost", "blah", "blah");
if (!$db)
{
echo "Error: Could not connect to database.";
exit;
}
mysql_select_db("blahblah");
$query = "select * from auth where password = ".$password."";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "Number of Rows: ".$num_results."";
mysql_close($db);
?>

It connects fine, and when the query returns NO (0) rows, it appears 
correct. However, when the query returns a record, I get the following 
error:


Warning: Supplied argument is not a valid MySQL result resource in picks.php 
on line 16

Where line 16 is the the line that says $num_results = 
mysql_num_rows($result);


Does anyone have any advice?

Appreciated in advance..

Greg



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to