mcmuney Posted January 19, 2008 Share Posted January 19, 2008 What's wrong with line 4 below? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/p/i/c/pickaloo/html/webprrank/test.php on line 4 <?php $zapytanie="SELECT COUNT(*) FROM catch WHERE url='$url'"; $wynik = mysql_query ("$zapytanie") or ("blad w pytaniu"); while ($rekord = mysql_fetch_array ($wynik)) { $liczba=$rekord[0]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/86761-solved-error/ Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 Try to var_dump($wynik); and see what it outputs. Quote Link to comment https://forums.phpfreaks.com/topic/86761-solved-error/#findComment-443424 Share on other sites More sharing options...
mcmuney Posted January 19, 2008 Author Share Posted January 19, 2008 gave me: bool(false) Quote Link to comment https://forums.phpfreaks.com/topic/86761-solved-error/#findComment-443428 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 In that case the query probably failed. Try running the query manually using e.g. the MySQL command line or GUI tools like phpMyAdmin and see what the result is. Quote Link to comment https://forums.phpfreaks.com/topic/86761-solved-error/#findComment-443431 Share on other sites More sharing options...
kenrbnsn Posted January 19, 2008 Share Posted January 19, 2008 This line <?php $wynik = mysql_query ("$zapytanie") or ("blad w pytaniu"); ?> should be <?php $wynik = mysql_query ("$zapytanie") or die ("blad w pytaniu<br>" . mysql_error()); ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/86761-solved-error/#findComment-443477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.