Re: pg_fetch_array won't work
| From: | Dave Reinhardt | Date: | Sun, 25 Jun 2000 15:08:45 +0000 |
| Subject: | Re: pg_fetch_array won't work | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-613@lists.php.net to get a copy of this message | ||
you are using the field name instead of the increment value for the
array.
Dave
-------------------------------------------------------------
On Fri, 23 Jun 2000 22:05:59 -0700 (PDT)
Renato Moutinho <rmsilva_br@yahoo.com> wrote:
>>-Hello Doug,
>>-
>>- Thanks for helping. But I tried that and it didn't
>>-work. Got the same result..
>>-If you or someone else have another clue I would
>>-be very grateful..
>>-
>>-All the best,
>>-
>>-Renato Moutinho Silva
>>-
>>---- Doug Semig <dougslist@c3net.net> escreveu: >
>>-> 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..
>>-
>>-
>>-__________________________________________________
>>-Do You Yahoo!?
>>-Get Yahoo! Mail - Free email you can access from anywhere!
>>-http://mail.yahoo.com/
>>-
>>---
>>-PHP Database Mailing List (http://www.php.net/)
>>-To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>>-For additional commands, e-mail: php-db-help@lists.php.net
>>-To contact the list administrators, e-mail: php-list-admin@lists.php.net
>>-
>>-