session_start();
include 'assets/config.php';
if(isset($_POST['username'])){
$queryIsUsername = ("SELECT count(user) FROM users WHERE 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
}
我不确定出了什么问题,这是我的错误。我删除了 if 语句,错误消失了。
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