Pramit Gohel
Pramit Gohel

Reputation: 31

Error in the page

I am creating a php script for my android application which will authenticate the user. In the script the following error is occurring:

Connected Welcome You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '‘ AND Password = ‘' at line 1

query :- $query = "SELECT * FROM admin WHERE Username = ‘$un’ AND Password = ‘$pw’";

$result = mysql_query($query) or die(mysql_error());; 

Upvotes: 0

Views: 45

Answers (1)

Anirudh Ramanathan
Anirudh Ramanathan

Reputation: 46728

The quotes you are using appear to be different. You should use the ascii single quote character on either side of your values.

query :- $query = "SELECT * FROM admin WHERE Username = '$un' AND Password = '$pw'";

Also ensure the right values are present within $un and $pw

Upvotes: 5

Related Questions