I'm working on a webmapping application that manage geological documents. I'm using PostgreSQL and Geoserver I'm trying to fetch the data on PostgreSQL with PHP and display it on web page. This is my php script
<?php
//mb_internal_encoding("UTF-8");
$conn = pg_connect("host=localhost port=5432 dbname=Gestion_Documents user=****** password=***")
or die('Connexion impossible : ' . pg_last_error());
$query = 'SELECT * FROM gisement';
$res = pg_query($query)
or die('Échec de la requête : ' . pg_last_error());
$cols = pg_num_fields($res);
$rows = pg_num_rows($res);
for ($k = 0; $k < $rows; $k++){
for ($j = 0; $j < $cols; $j++) {
$line = pg_fetch_result($res, $k, $j);
echo '"'.pg_field_name($res, $j).'": '.$line.", ";
}
echo "
";
}
//=========================================
//echo pg_fetch_result($res, 0, 0);
//=========================================
pg_free_result($res);
pg_close($conn);
?>
This script work perfectly with Wampserver, But it does not work when i try to run it on Geoserver So I'm trying to find a way to run the script on Geoserver.