Search code examples
phpmysqlquotation-marks

Too many quotation marks in mysql


my problem is too many quotation marks.

$come = mysql_query("SELECT * FROM users WHERE email="$_POST['email']" and password="$_POST['password']" ");

Then I tried this but it doesn't work ...

$come = mysql_query("SELECT * FROM users WHERE email="/$_POST['email']/" and password="/$_POST['password']/" ");

Please help me :/


Solution

  • $come = mysql_query("SELECT * FROM users WHERE email='".$_POST['email']."' and password='".$_POST['password']."' ");
    

    Try this it should fix your issue. But mysql is deprecated consider mysqli or pdo.