0
$u = mysql_real_escape_string($_POST["username"]);
$p = sha1($_POST["passwd"]);
$q = "SELECT * FROM profile WHERE email=`$u` AND passwd=`$p`";
$run = mysql_query($q);
  if(!$run){
    echo mysql_error();
  }

this creates Unknown column 'mymail@gmail.com' in 'where clause' error. This code is from a tutorial and a piece of a submit-new-post php page.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by gk1993
1
$q = "SELECT * FROM profile WHERE email=`$u` AND passwd=`$p`";

replace it with

$q = "SELECT * FROM profile WHERE email='$u' AND passwd='$p'";
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.