My error gives 1064 it worked before i inserted the where statement. Do i put the where before or after the from?
<?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);
?>