Jump to content

SQL falling down when and statement used.


beebosoft

Recommended Posts

I am trying to check to see if someone has registered and log them in to a site.  I am using the following syntax.

$resultID = mysql_query("SELECT * FROM user where username = '$username' AND password like '$password'", $linkID)or die(mysql_error());

If I omit the AND password like '$password'  it brings me down records but when I add this bit in  it fails everytime.  I have used this before with no problems..  

 

Any help greatly appreciated.

 

Angie

 
Link to comment
Share on other sites

I have no idea what that URL you posted is supposed to be. It doesn't say anything about what the username and password are. Can you not be bothered with doing a var_dump() on the values used in the query and the values in the database? How do you "see" the values in the database? I assume you are using PHPMyADmin or some other database utility and are looking at the values displayed on the screen. What if a value had an extraneous space, or other non-printable character, at the beginning or end? Do you think you would "see" it? You are asking for help from people that do not have access to your code and database. You need to be sure to give us every opportunity to help you by providing as much relevant information as possible.

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.