Jump to content


Photo

Select problem


  • Please log in to reply
2 replies to this topic

#1 slipperyfish

slipperyfish
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 10 February 2006 - 08:07 PM

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?

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 10 February 2006 - 08:35 PM

Remove the "or die" part and use echo mysql_error(); right after the query. That may give you more information.

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 February 2006 - 09:03 PM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users