问题: 我请我问一下。 我希望能够把这个数字拉到一个阵列中(现在我就是这样),但随后从各行中取出一个具体价值,得出一些数学(我有这句话),然后把这一数学的结果加到同一阵列或新阵列中最后(或一开始)能够提供的价值。
这样做是为了确定目前构成SQ查询的一部分的地点,然后确定每次活动(每行一次)的距离。
页: 1 Query -> 检查活动地点-> 在现有地点运行远距离数学,以进行活动-> 改装成像(SQL Query + Distance)一样,准备用于 j子。
我将补充说,我已设法这样做,以便用Xml的方式去做,但是,在操纵阵列方面,Im仍是一个灯塔。
成就
Terran
// Connect to database server
$con = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword) or die(mysql_error());
mysql_select_db($config_databaseName, $con);
// Access tables
$sql = "SELECT * FROM " . $config . " WHERE LAT <" . $toplat . " AND LAT > " . $bottomlat . " AND LONG > " . $leftlon . " AND LONG < " . $rightlon . " AND VALIDPERIOD_STARTOFPERIOD < " . $nowtime . " AND VALIDPERIOD_ENDOFPERIOD > " . $nowtime ." )";
// Execute query
$result = mysql_query($sql) or die(mysql_error());
$lata = $latitude;
$lona = $longitude;
// Need to populate these from each row values in the query
$latb = $sqllat;
$lonb = $sqllong;
// need to place this in to a colum at the end of each row
$distancefromevent = coordDistance($lata, $longa, $latb, $lonb, "m");
// need to reform all the above so I can carry on and use the code that follows
$responses = array();
if(mysql_num_rows($result)) {
while($response = mysql_fetch_assoc($result)) {
$responses[] = array( dataitem =>array_map( utf8_encode ,$response));
}
}
header( Content-type: application/json );
$json = json_encode(array($config_datexdeftype=>$responses));
$callback = $_GET[callback];
echo $callback . ( . $json . ) ;
};
return TRUE;