PDA

View Full Version : PHP/mySQL woes...



coolblu
July 5th, 2003, 13:01
Hey All!

having a little trouble with a PHP script that is supposed to query a mySQL database. All is fine until the script should return no results - and it just returns a blank screen :confused:

The code can be found at http://www.zapfreebies.com/ja/dos.txt - sorry I didnt post it in the forum it is a bit long ;)

thanks :D

Nick

ECTrimble20
July 8th, 2003, 00:49
else {
echo "No Results";

}


try replacing the 'else' code with that, looked to me like it was all jumbled with commented out stuff.

coolblu
July 9th, 2003, 15:21
still no luck :confused: anyone have any other ideas?

ssba
July 9th, 2003, 16:52
After looking through this script.. I noticed one thing: (line 52)

if (!$numrows == 0)

(this is the if() to the else{} that you have stating there are no hits.) This is saying if $numrows doesnt exist equal to zero?

try something like this:

if($numrows)

or

if(defined($numrows))

instead of trying to do the reverse of something not existing? :P

coolblu
July 11th, 2003, 18:46
Thanks for your help everyone but Ive sorted it out now.
If anyone is interested I managed to get round the problems that mysql_num_rows was returning NULL (not zero) by using the intval function (so that it did return zero) with a little help from a friend ;)

Thanks again