SQL commands showing up as string

49 Views Asked by At

This is my code

$query = "SELECT * FROM users WHERE email='".mysqli_real_escape_string($link, $_POST['loginemail'])."'AND 
    password='".md5(md5($_POST['loginemail']) .$_POST['loginpassword']). "'LIMIT 1";

In my text editor, the AND and LIMIT commands show up as strings. I cannot figure out why. Can anyone help?

1

There are 1 best solutions below

1
On

I think its Sublime problem, CMIIW, if it realy matter for you you can change the code like this..

  $email = mysqli_real_escape_string($link, $_POST['loginemail']);
  $password = md5(md5($_POST['loginemail']) .$_POST['loginpassword']);
  $query = "SELECT * FROM users WHERE email='$email' AND 
            password='$password' LIMIT 1";

Note: I assume it's php code..