using pg_fieldisnull

Поиск
Список
Период
Сортировка
От Christopher Smith
Тема using pg_fieldisnull
Дата
Msg-id 4A25691A.0080A609.00@g000600.gio.com.au
обсуждение исходный текст
Список pgsql-novice

Hi all,

Just wondering if anyone can give me some examples on how to use pg_fieldisnull.
This is the reason why.. Currently I have this loop set up to get all data from
a database (I'm just doing a simple one at the moment until I can teach myself
some more :)..). I figure there's a lot better way to do this using
pg_fieldisnull or some other means.

$numrows = pg_numrows($result);
$row=0;
printf ("<table border=1>\n");
printf ("<tr><td>ID</td><td>First Name</td><td>Surname</td></tr>\n");
do
{
  $myrow = pg_fetch_row ($result,$row);
  printf ("<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[0], $myrow[1],
$myrow[2]);
  $row++;
}
while ($row < $numrows);

it doesn't nescessarily have to put it into a table, so formatting it isn't a
problem.  Any suggestions? I know there's a better way to do this, but I can't
think of it :(
I'm using pgsql6.5.3 and php4.

Thanks,
Chris.



В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Re: newbie problem on creating table
Следующее
От: "Carsten Huettl"
Дата:
Сообщение: pgsql setup