Mysql查询在SQLyog中工作,而不是由浏览器读取

时间:2016-08-17 16:26:51

标签: mysql

mysql查询中此代码中的错误是什么??? 我认为这是一个非常容易的问题但是找不到错误:(虽然这个mysql查询在SQLYog中工作

$result =mysql_query(SELECT NUMPOINTS((i.geom))COUNT FROM district i WHERE district_name="D.G.KHAN";)

竞争代码是     

//$type="R";
$result =mysql_query(SELECT NUMPOINTS((i.geom))COUNT FROM district i WHERE district_name="D.G.KHAN";)
$row2 = mysql_fetch_array($result);
$count=$row2['count'];
$x_points = array();
$y_points = array();
/* $row1 ['color']="00000"; */
for($c=1;$c<=$count;$c++){
    $res=mysql_query("SELECT district_name,X ( POINTN ( i.geom ,$c))xx ,Y( POINTN ( i.geom ,$c))yy ,color FROM district i where dis_id='".$id."'" );
    while($row1 = mysql_fetch_array($res)){
    array_push($x_points['xx']);
    array_push($y_points['yy']);    
 }
}

print_r ($x_points);
print_r ($y_points);


?>

1 个答案:

答案 0 :(得分:1)

您需要添加为字符串:

$result =mysql_query("SELECT NUMPOINTS((i.geom)) FROM district i WHERE district_name='D.G.KHAN'";)