我试图逐行显示,但它显示此错误:
未定义的偏移量:0
这是我的代码:
<?php
$host = "localhost";
$user = "postgres";
$password = "20152016";
$db = "Projet";
$con = pg_connect("host=$host dbname=$db user=$user password=$password")
or die ("Could not connect to server\n");
?>
<?php
$query = "SELECT ST_ASGeoJSON(geometry) FROM poi where type='batiment'";
$result = pg_query($con, $query);
while ($row = pg_fetch_assoc($result))
{
$data = array();
echo $data[0];
}
?>