Re: Re: Bad column offset?
| От | Mauricio C. de Oliveira |
|---|---|
| Тема | Re: Re: Bad column offset? |
| Дата | |
| Msg-id | 36ADAAED.D0D1B4E2@dt.fee.unicamp.br обсуждение исходный текст |
| Список | pgsql-general |
Hi Paulo!
In your query you have the following select:
> $result = pg_exec( $pgconn, "select htl.nom_htl from htl where
> htl.des_det_htl='s'" ) or die("Query formatted wrong!");
Everything goes well until you try:
> $temp = pg_result($result, $i, "htl.nom_htl");
>
> Warning: Bad column offset specified in
> /usr/local/etc/httpd/htdocs/myscript.php3 on line 21
Even though you have requested the column "htl.nom_htl" from the table "htl", an error is generated since the column
labelreturned
by postgres is simply "nom_htl", hence the bad column offset (label, in this case)! Of course you can change this label
byusing an
alias. Try replacing the label in the "pg_result" by:
$temp = pg_result($result, $i, "nom_htl");
This should work. Bye, Mauricio
--
Mauricio Carvalho de Oliveira
mailto:carvalho@dt.fee.unicamp.br
http://www.dt.fee.unicamp.br/~carvalho
В списке pgsql-general по дате отправления: