Guest_imported
New member
- Jan 1, 1970
- 0
Hi All,
I'm having trouble with a simple command. I have two PHP pages, one submits data to the other for a search on a MySQL database. The first is a basic form, so the code is correct on that one, it's the second that is generating the error. Here is a summary of the code... any hints?
$link = mysql_connect($DBhost,$DBuser,$DBpass);
mysql_select_db("$DBName",$link);
$sqlquery = "SELECT * FROM $table WHERE usrname = $usrname";
$result = mysql_query($sqlquery,$link);
$num_rows = mysql_fetch_row( $result ); <=--- Error is generated on this line
When running the code, the following error is generated:
Warning: Supplied argument is not a valid MySQL result resource in d:\html\php\results.php on line 17
I have checked the PHP.net web site for the arguments on this command, and they're correct as far as I can tell... yet the error is still appearing... Any help would be much appreciated.
Jon
I'm having trouble with a simple command. I have two PHP pages, one submits data to the other for a search on a MySQL database. The first is a basic form, so the code is correct on that one, it's the second that is generating the error. Here is a summary of the code... any hints?
$link = mysql_connect($DBhost,$DBuser,$DBpass);
mysql_select_db("$DBName",$link);
$sqlquery = "SELECT * FROM $table WHERE usrname = $usrname";
$result = mysql_query($sqlquery,$link);
$num_rows = mysql_fetch_row( $result ); <=--- Error is generated on this line
When running the code, the following error is generated:
Warning: Supplied argument is not a valid MySQL result resource in d:\html\php\results.php on line 17
I have checked the PHP.net web site for the arguments on this command, and they're correct as far as I can tell... yet the error is still appearing... Any help would be much appreciated.
Jon