hmm... you've gone wrong in a couple ways. :)
pg_query will only return false if there's an error with your query or
couldn't connect, or whatever.
$result = pg_query($conn, "select othermore from table where othermore
<> ''");
if ( !$result )
echo 'error! - abort abort';
else {
while ($row = pg_fetch_array($result)) {
echo $row[0].'<br>';
}
}
sylviestone@canada.com (Sylvie Stone) wrote in message news:<181a24a8.0309170613.421bd49@posting.google.c om>...[color=blue]
> Hi All -
>
> I'm doing a fetch_array and I would like to display a "no records
> found" message to screen. For some reason this is not working:
>
> here's my Postgres SQL as proof:
> surveys=# select othermore from table where othermore <> '';
> othermore
> -----------
> (0 rows)
>
> Then I have:
> $result = pg_query($conn, "select othermore from table where
> othermore <> ''");
> while ($row = pg_fetch_array($result)) {
> if (!$result) {
> echo "no records<br>\n";
> } else {
> echo "$row[0]<br>";
> }
> }
>
> Strnage ? Can someone shed some light on what UI am doing wrong ?
>
> THANKS
>
> Sylvie.[/color]