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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -