gergy008 Posted May 27, 2010 Share Posted May 27, 2010 $run=mysql_query("SELECT `verifid` FROM `users` WHERE `login`=$user", $link); if(mysql_num_rows($run)==1){ These lines seem to be giving me the 'Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource' error. Looks fine to me, But probably my fault. Thanks in advance. Here is the whole function if you need it: function getverid($user){ global $link; $run=mysql_query("SELECT `verifid` FROM `users` WHERE `login`=$user", $link); if(mysql_num_rows($run)==1){ $item=mysql_fetch_array($run); echo($item[0]); return($item[0]); } } The fuction is called with getverid($_POST["login"]) which I know is set... So what's going on? Link to comment https://forums.phpfreaks.com/topic/203127-not-a-valid-result-resource/ Share on other sites More sharing options...
kenrbnsn Posted May 27, 2010 Share Posted May 27, 2010 You have a syntax error in your query. If you replace <?php $run=mysql_query("SELECT `verifid` FROM `users` WHERE `login`=$user", $link); ?> with <?php $q = "SELECT verifid FROM `users` WHERE `login`=$user", $link"; $run = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); ?> It would show the error. The error is WHERE `login`=$user", $link -- what's the , $link? (nevermind) Ken Link to comment https://forums.phpfreaks.com/topic/203127-not-a-valid-result-resource/#findComment-1064294 Share on other sites More sharing options...
-Karl- Posted May 27, 2010 Share Posted May 27, 2010 $link is probably the problem, show more of the code or try to debug the query. EDIT: Okay, I can see where $link is now. Like kenrbnsn said, debug the query to show the error. Link to comment https://forums.phpfreaks.com/topic/203127-not-a-valid-result-resource/#findComment-1064298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.