multiple record query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mccommunity
Forum Commoner
Posts: 62
Joined: Mon Oct 07, 2002 8:55 am

multiple record query

Post by mccommunity »

I am doing a query on a table

Code: Select all

їb]$querymain = "SELECT * FROM auction_event_info WHERE client_event_id='$eventid'";
$r = pg_exec($c,$querymain);ї/b]

Say there are two records with the same $eventid if I use:

Code: Select all

їb]$info = pg_fetch_array($r, 0);ї/b]
it will pull the first occurance row with this event id. How do I do the same but skip the first row and pull the second row? Can I do this:

Code: Select all

їb]$info2 = pg_fetch_array($r, 1);ї/b]
Will the above pull an array of the second occurance? If not how do I do this?
steve@oeic.net
Forum Newbie
Posts: 8
Joined: Wed Feb 18, 2004 2:47 pm

Post by steve@oeic.net »

$info2 = pg_fetch_array($r, 1); should work fine. If not, you can compare the event_id fields from $info and $info2, and if they are the same, just output $info2.
Post Reply