I have this piece of code
<?
$db = pg_connect("host=h port=p dbname=dbn user=usr password=pass");
if ($db) {
echo 'Connection attempt succeeded.' . '<br>' . '<br>';
}
else{
echo 'Connection attempt failed.' . '<br>' . '<br>';
}
$query = "SELECT column1 FROM table";
$result = pg_query($db, $query);
while ($row = pg_fetch_array($result)) echo $row. '<br>'. '<br>';
echo pg_dbname($db). '<br>' ;
echo pg_get_pid($db);
?>
The result should be three numeric values. When I run it, all I get are three strings "Array".
Connection attempt succeeded.
Array
Array
Array
dbname
pid
Can anyone help, please?
echo array();You can't simplyechoarrays.echo $row['column1']and don't echo the array use instead print_r/var_dump functions