I have a PHP script that signs a user into my site when they enter the correct login credentials. However, I noticed that it is easy to inject this login by entering anything' OR 'x'='x into the password box.
How can I stop this from happening?
$query = "SELECT * FROM sm_editors WHERE email = '".$_POST['email']."' AND password = '".$_POST['password']."' AND user_type != 'reader-for-approval'";