unable to login in php mysql

Codes here !

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 50
Joined: Fri Jan 20, 2012 8:00 am

Tue Jul 31, 2012 8:54 am

i dont think it will be causing your problem but you dont need

Code: Select all


Code: Select all

will get the job done!

there are a few things i would try to resolve this issue firstly put your table and field names inside ` `

Code: Select all

$sql="SELECT * FROM `user` WHERE `LoginName`='$myusername' AND `Password`='$mypassword'";
and if all else fails extract your query from phpmyadmin and then just add your php variables to that. the amount of times ive not been able to work out what was wrong with my query and ive extracted it and still not been able to tell the difference but its worked anyway!

User avatar
php-forum Active User
php-forum Active User
Posts: 365
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Thu Aug 02, 2012 1:29 pm

The first thing to do is echo back your query and put that into phpmyadmin to see if it runs. Usually that will give you the error, if it isn't obvious just from looking at the echoed query.

Also, you should switch from using mysql to mysqli/PDO as mysql is not secure.

php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Thu Aug 02, 2012 11:24 pm

The error your getting is quite specific - the table doesn't exist. Have a look at your database and check that the there is in fact a table called 'user' in the schema you've specified.

Post Reply