Jump to content

[SOLVED] MySQL result resource Error


dizzy1

Recommended Posts

hi, im tryin to find out how may rows thier are in a sql im doing, the answer should be 0. THis is the error msg i get:

 

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fhlinux144/user/htdocs/Search.php on line 388

 

$mysql  = " Select * from  ";								
$mysql .= " venue ";


$temp = mysql_query($mysql);			
Line 338: $NumRows = mysql_num_rows($temp); 

echo "NumRows: $NumRows <br>";

 

 

i need to know the value of NumRows so i can see if the value is not equal to 0 so it will continue

 

if ($NumRows  != 0 ){
//DO SOMTHING
}

 

Thanks In Advance

Dizzy

 

 

Link to comment
https://forums.phpfreaks.com/topic/141598-solved-mysql-result-resource-error/
Share on other sites

i changed it to:

 

$mysql  = " Select * from  ";                        
$mysql .= " venue ";

$temp = mysql_query($mysql);	

if(mysql_num_rows($temp) != 0) { 
{

 

But still didnt work i tried changing the mysql_query to fetch_array and the error turned into a fatal error.

 

i tried puttin in mysql_error(); all over the place and it didnt do anything.

 

help me please ???

 

<?php
$temp = mysql_query($mysql)or die(mysql_error()); ?>

<<< add it tell us what failing mate.

 

Cheers everyone tat is a brilliant piece of syntax mysql_error(), when used correctly, it basically told me the table didnt exist and the reason it didnt exist was becuase the damn table callled venue should of been spelt Venue, capital V.

 

THANKS EVERYONE FOR ALL YOUR TIME AND PATIENCE. ;D ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.