Jump to content

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


Prismatic

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 :(
Link to comment
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]
Link to comment
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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.