我的錯誤提供了1064它在我插入where語句之前工作。我把之前或之後的地方放在哪裏?Mysql語法似乎是正確的,但給出了錯誤代碼1064
<?PHP
session_start();
include ("connection.php");
$city = $_POST['city'];
$state = $_POST['state'];
$results = array();
if($query = $db->query("SELECT business_id, BusinessName, date, post ".
"FROM WolfeboroC.posts ". "WHERE city= '$city' && state='$state'".
"JOIN WolfeboroC.users ON users.recid = posts.business_id ".
"ORDER BY date DESC LIMIT 0, 500"))
{
while($record = $query->fetch_assoc())
{
$results[] = $record;
}
$query->close();
}
echo json_encode($results);
?>
把你的'&&'換成'AND' –
哦,對吧,我是在php思考模式下謝謝 – user2354835
它發生了,沒有造成任何傷害。 –