Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong with this query.

Status
Not open for further replies.

wraygun

Programmer
Dec 9, 2001
272
US
I'm attempting to determine if this user exists. But returns "Resource ID #21" for some reason.

Code:
$strSQL = mysql_query("SELECT * FROM bandinfo WHERE username = 'jampa5'");
  
echo $strSQL;

The connection string is working great and I can add records fine, but I can't seem to wrap my mind around this. Any help would be greatly appreciated.

Thanks,
Harold


***You can't change your past, but you can change your future***
 
After you do the query, you have to get the results or the number of rows affected.

Code:
$num = mysql_num_rows($strSQL);
if ($num == 0) // no such user
else  // user exists

Ken
 
Awesome!

Thank you so much! That was just the push I needed!

Harold

***You can't change your past, but you can change your future***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top