Jump to content

Some help needed


sadanmasroor

Recommended Posts

Hello Everyone,

                        I am facing a problem and hope that you guys are going to be of any help. I am not a newbie but this is the first time ran into a problem like this and did not find a solution to it. Below is the description of the problem I am facing right now :

 

I am trying to create an authentication page on the project I am working on. Now there are two variables :

 

$username ;

$password;

 

I have a database table by the name of members. Now when I run the following sql query it returns empty results:

 

$sql = "SELECT * FROM members WHERE username = '{$username}' AND password = '{$password}'  LIMIT 1 ";

 

 

Now if I run the query below it works just fine :

 

$sql = "SELECT * FROM members WHERE username LIKE '%{$username}%' AND password LIKE '%{$password}%' LIMIT 1 ";

 

 

I am using 5.1.47-community-log as my server. Before posting it here I have checked that there is a table by the name of 'members'  in the the database and there are column names as username and password.

 

Any help would be appreciated.

 

Thanks in advance.

Link to comment
Share on other sites

as mentinoned before I am not a new bie. I am actually a ruby on rails developer as well. The values and trim and sanitized before being entered in the database.

 

And as far as form is concerned I am facing this problem even in PHPmyadmin not only in form.

 

I am developing the application on live server and the hosting is with BlueHost.

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.