Jump to content

Archived

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

slipperyfish

Select problem

Recommended Posts

Hey guys, having real problems with my login script..

$sql = "SELECT * FROM bu_users WHERE username='$usernameIn' AND password='$passwordIn'";
$result = mysql_query($sql) or die("Could not Query.");
$result2 = mysql_fetch_array($result);

i cant see problems with my MySQL, but it just keeps saying "Could not Query."... any suggestions?

Share this post


Link to post
Share on other sites
Remove the "or die" part and use echo mysql_error(); right after the query. That may give you more information.

Share this post


Link to post
Share on other sites
Agreed -- for the looks of it, either the table or field(s) don't exist, or you don't have a valid DB connection. The mysql_error() will tell you for certain.

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.