Hi,
I am retreiving set of information from postgresql database. I am taking 3 columns of a table in my select query. this returns multiple rows.
How can display each column of a row for all the rows retrieved in php?
I tried couple of things with pg_fetch_array but it doesn\'t display the data what I need.
$query="select a,b,c from xyz where ..."; //this retrieves say 3 rows
$result=pg_query($query);
$rows=pg_numrows($result);
if($rows>0)
{
for($i=0;$i<$rows;$i++)
{
$data=pg_fetch_array($result,$i); // now $data contains each row
}
}
I am just giving piece of code. With pg_fetch_array, will I get all the 3 columns of a row? I am not able to access the second and third column with the above code. It just gives me the first column in all the 3 rows which are retrieved.
Can anybody advice how to achieve this?