PHP SQL Syntax Error? -
session_start(); include 'assets/config.php'; if(isset($_post['username'])){ $queryisusername = ("select count(user) users user = '$_post['username']'"); //error $actionqueryisusername = mysql_query($queryisusername); while($rowisusername = mysql_fetch_array($actionqueryisusername)) { $isusername[] = $rowisusername['count(user)']; } if($isusername[0]="0"){ header("location: login.php?error=e1"); } else{ //do stuff }
i'm not sure whats wrong, error. removed if statement , errors vanished.
parse error: syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string in /applications/xampp/xamppfiles/htdocs/craftlist/index.php on line 7
change to
$queryisusername = ("select count(user) users user = '".$_post['username']."'");
but not sql injection safe!
Comments
Post a Comment