I would like to fetch an Oracle 10g table to JSON in PHP in order to sparse it in GMap APIv3. So far I can fetch the first line of the Oracle table but I dont know how to do it for all.
I use this so far:
$conn = oci_connect($user, $pass, $host);
$sql = oci_parse($conn, "select * from POINTS_CS_FRANCO WHERE CODE_CS = '711'");
oci_execute($sql);
class User {
public $Code_CES = "";
public $Nbr_Electeur = "";
public $lat = "";
public $lng = "";
}
while ($row = oci_fetch_assoc($sql)){
$user = new User();
$user->Code_CES = $row['CODE_CES'];
$user->Nbr_Electeur = $row['NBR_ELECTEUR'];
$user->lat = $row['LATITUDE'];
$user->lng = $row['LONGITUDE'];
}
echo json_encode($user);
?>
// Returns: {"Code_CES":"CES 000","Nbr_Electeur":"8","lat":"48.834997","lng":"-67.530141"}
Then im not sure if the JSON output would be well-strutured like this to sparse in GMap if it would be complete.