Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: five minus five?
(Example: nine)

The Note You're Voting On

!spamcraig at ahdore dot com
24 years ago
If you want to extract data from select statements, you need to store the result index, and then apply pg_result to that value. Basically, do this

$resultIdx = pg_query ($database, "select * from tablename");
$mySelect = pg_fetch_result($resultIdx, 0, 0); // gets column 0 of tuple 0
echo("My select: [".$mySelect."]");

I'm new to php and had to do some fiddling around to work this out. It's reasonably elementary, but not demonstrated by the examples on these pages. Hopefully it will come in useful to someone else.

<< Back to user notes page

To Top