PHP脚本意外T_VARIABLE

时间:2016-02-28 04:23:59

标签: php mysqli

我在PHP脚本的下一行收到此错误,该脚本负责执行mysqli_query。我不确定它为什么会出现在那里:

syntax error, unexpected T_VARIABLE, expecting ']'

<?php
$response = array("error" => FALSE);


if (isset($_POST['city']) && isset($_POST['offset']) != '') {

 $city= $_POST['city'];
 $offset = $_POST['offset];




 $conn=mysqli_connect("****.com", "***", "***","****");


$get_images= mysqli_query($conn,"SELECT user_id, image, longitude, latitude, city, geo_name_id, description, score, Categories FROM images WHERE geo_name_id = '$city' LIMIT 10 OFFSET '$offset'");

 $myArray = array();
$returnArray = array();
while($row = $get_images->fetch_array())
{
 $myArray["user_id"] = $row["user_id"];
 $myArray["image"] = $row["image"];
 $myArray["longitude"] = $row["longitude"];
 $myArray["latitude"] = $row["latitude"];
 $myArray["city"] = $row["city"];
 $myArray["geo_name_id"] = $row["geo_name_id"];
 $myArray["description"] = $row["description"];
 $myArray["score"] = $row["score"];
 $myArray["Categories"] = $row["Categories"];

 $returnArray[] = $myArray;
}
echo json_encode($returnArray);


  }   

  ?>        

我真的没有看到]在这里......

1 个答案:

答案 0 :(得分:2)

您错过了以下的详细报价:

$offset = $_POST['offset'];

应该是:javamail api而不是。