checking a login php script

I have a php login in script and it doesn't seem to work, I put the username in and password but it shows incorrect password or username.I know they are correct.
I checked my mysql with a test mysql and it is working,

But the login script does not seem to be connecting to the database.

My config file seems to be filled out correctly.

I am putting up my config file, login file.
If there is anything else you need let me know

This is just a test program so I am not worry about passwords they can alway be change
login.php
config.php
starviewAsked:
Who is Participating?
 
starviewConnect With a Mentor Author Commented:
I found my problem:
I changed :
$sql = "SELECT user_id
From tbl_user
WHERE user_name = '$userName' AND
user_password = PASSWORD('password')";

To

$sql = "SELECT user_id
From tbl_user
WHERE user_name = '$userName' AND
user_password = 'password'";
0
 
rinfoCommented:
You should have included functions.php - which i understand defines doLogin() function.
0
 
starviewAuthor Commented:
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
starviewAuthor Commented:
for to enter it
0
 
rinfoCommented:
You have used password function in the query  for mysql.
This function has know to fail when password field is defined having  less then 15 varchar.
Just increase the field for password to varchar(16) and see if it works ok .
0
 
starviewAuthor Commented:
varchar is set at 32
0
 
starviewAuthor Commented:
That has been change in the function, but still does not connect.
0
 
starviewAuthor Commented:
It was the only solution that would work
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.