From: | Chris <csmith(at)squiz(dot)net> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: novice, question |
Date: | 2001-02-12 05:28:48 |
Message-ID: | 4.3.2.7.2.20010212162635.00b93900@203.25.173.1 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hey,
What you might have to do is
$total_rows = pg_numrows($result);
do {
pg_fetch_object($result,$i);
$i++;
} while ($i < $total_rows);
>Andy Arledge wrote:
> >
> > anyone have an idea why this won't work? when i print out "i" it says 893,
> > but it should be 41. and the values are null for the array $userinfo.
> >
> > thanks in advance,
> >
> > andy arledge
> >
> > if(!($result= pg_exec($link, "SELECT * from signup, info1, info2 where
> > (signup.username='$uname' or
> > info1.username='$uname' or
> > info2.username='$uname');"))){
> > DisplayErrMsg(sprintf("Error in executing line %s stmt",
> > $selectStmt));
> > exit();
> > }
> > for($i = 0; $userinfo = @pg_fetch_object($result, $i); $i++);
>
>Why is there an '@' in front of that pg_fetch_object call?
So it doesn't print an error when there are no results left.
------------------------
Chris Smith
http://www.squiz.net
From | Date | Subject | |
---|---|---|---|
Next Message | Eric Frazier | 2001-02-12 07:05:26 | JDBC driver docs |
Previous Message | Andrew McMillan | 2001-02-12 05:11:34 | Re: novice, question |