Re: pg_fetch_array won't work
| From: | Doug Semig | Date: | Fri, 23 Jun 2000 05:27:43 +0000 |
| Subject: | Re: pg_fetch_array won't work | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-586@lists.php.net to get a copy of this message | ||
Try changing your SQL to "select d1, d2 from test".
Doug
At 04:39 PM 6/22/00 -0700, Renato Moutinho wrote:
>Hi folks,
>
> I've been trying to use the associative array
>returned from pg_fetch_array but couldn't find out
>how. The scenario:
>
>TABLE test:
> d1 int,
> d2 char(50)
>
>The PHP code goes like this:
>
> $conn = pg_connect("dbname=mydb");
> $result = pg_Exec($conn,"select * from test");
> $arr = pg_fetch_array($result, 0);
> echo $arr["d1"];
>
>The result is blank.. nothing printed out. If
>I use $arr[0] I get what I wanted.. Anyone has
>a clue on this ?
>
>P.S.: PHP 3 with PGSQL6.5 AND PHP4 with PGSQL7.0.2
>behave the same way..
>
>Thanks in advance,
>
>--
>Renato Moutinho Silva = rmsilva_br@yahoo.com