[solved]
Moderator: General Moderators
-
gaogier
- Forum Contributor
- Posts: 391
- Joined: Wed Mar 02, 2005 1:02 pm
- Location: Portsmouth, UK
- Contact:
[solved]
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gaogier/public_html/sreport.php on line 15
The Special Reports guide requested cannot be found
i dont know what that error means, if you can explain it, ill be greatful
The Special Reports guide requested cannot be found
i dont know what that error means, if you can explain it, ill be greatful
Last edited by gaogier on Tue Apr 11, 2006 2:03 pm, edited 1 time in total.
-
gaogier
- Forum Contributor
- Posts: 391
- Joined: Wed Mar 02, 2005 1:02 pm
- Location: Portsmouth, UK
- Contact:
the code has been cut down to what i think is the error
Code: Select all
function spview($id) {
require_once ('../mysql_connect.php');//connect to db
/* query for item */
$query = "SELECT * FROM sp WHERE id=$id";
$result = mysql_query ($query);
/* if we get no results back, error out */
$numrtn = mysql_num_rows($result); /*line of error */
if ($numrtn == 0) {
echo "The Special Reports guide requested cannot be found\n";
echo $id;
return;
}You may want to try:gaogier wrote:the code has been cut down to what i think is the error
Code: Select all
function spview($id) { require_once ('../mysql_connect.php');//connect to db /* query for item */ $query = "SELECT * FROM sp WHERE id=$id"; $result = mysql_query ($query); /* if we get no results back, error out */ $numrtn = mysql_num_rows($result); /*line of error */ if ($numrtn == 0) { echo "The Special Reports guide requested cannot be found\n"; echo $id; return; }
Code: Select all
$query = 'SELECT * FROM sp WHERE id = "'. $id .'"';- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Thanks for posting your solution to help others 
Last edited by JayBird on Tue Apr 11, 2006 4:06 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: