Prismatic Posted May 17, 2006 Share Posted May 17, 2006 [code]$queryStr = "SLEECT * FROM users WHERE username = '". $this->username ."'";$queryRes = mysql_query($queryStr);$queryNum = mysql_num_rows($queryRes);[/code]Replacing the $queryStr line with this:[code]$queryStr = "SLEECT * FROM users WHERE username = 'prismatic'";[/code]it errors as well, which leads me to believe it's a syntax issue somewhere I cant spot :(The error is:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in class.php on line 149Is it a format issue? I cant seem to be able to spot the error :( Link to comment https://forums.phpfreaks.com/topic/9834-any-idea-why-this-bit-of-code-is-failing-query/ Share on other sites More sharing options...
samshel Posted May 17, 2006 Share Posted May 17, 2006 try some error handling like$queryRes = mysql_query($queryStr) or die (mysql_error());and it will show u the exact problem....hth Link to comment https://forums.phpfreaks.com/topic/9834-any-idea-why-this-bit-of-code-is-failing-query/#findComment-36530 Share on other sites More sharing options...
haydndup Posted May 17, 2006 Share Posted May 17, 2006 Well, for starters, you've spelt SELECT wrong[code]$queryStr = "SLEECT * FROM users WHERE username = 'prismatic'";[/code]should be:[code]$queryStr = "SELECT * FROM users WHERE username = 'prismatic'";[/code] Link to comment https://forums.phpfreaks.com/topic/9834-any-idea-why-this-bit-of-code-is-failing-query/#findComment-36537 Share on other sites More sharing options...
Prismatic Posted May 17, 2006 Author Share Posted May 17, 2006 [!--quoteo(post=374588:date=May 17 2006, 02:22 AM:name=WhyWindows)--][div class=\'quotetop\']QUOTE(WhyWindows @ May 17 2006, 02:22 AM) [snapback]374588[/snapback][/div][div class=\'quotemain\'][!--quotec--]Well, for starters, you've spelt SELECT wrong[code]$queryStr = "SLEECT * FROM users WHERE username = 'prismatic'";[/code]should be:[code]$queryStr = "SELECT * FROM users WHERE username = 'prismatic'";[/code][/quote]rofl, I knew it would be something as simple as that! Thanks! Link to comment https://forums.phpfreaks.com/topic/9834-any-idea-why-this-bit-of-code-is-failing-query/#findComment-36541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.