Jump to content

Archived

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

Prismatic

Any idea why this bit of code is failing? (query)

Recommended Posts

[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 149

Is it a format issue? I cant seem to be able to spot the error :(

Share this post


Link to post
Share on other sites
try some error handling like


$queryRes = mysql_query($queryStr) or die (mysql_error());

and it will show u the exact problem....

hth

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
[!--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!

Share this post


Link to post
Share on other sites

×

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.