Re: array question
| From: | Bernie Huang | Date: | Fri, 21 Jul 2000 18:27:47 +0000 |
| Subject: | Re: array question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1409@lists.php.net to get a copy of this message | ||
Cody Caughlan wrote:
> uh, Am I missing something or is this just a:
>
> SELECT * FROM....
>
> /Cody
>
> Bernie Huang wrote:
>
> > Hello,
> >
> > If I want to select all elements from Postgres array-field using PHP,
> > can I do it without fetching each element seperately?
> >
> > eg;
> >
> > tb1
> > ---------------
> > col1 {"I","have","no","problem"}
> >
> > "Select col1[1:4] from tb1";
> > $row= pg_fetch_array(...);
> > echo $row[col1[1]]; <----- didn't work
> >
> > and I am hoping to avoid "select col1[1], col2[2]..." Thanks.
> >
> > - Bernie
> >
> >
> ------------------------------------------------------------------------
> > --
> > 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
>
> --
> Cody Caughlan -codyc@cisco.com- Cisco Systems
> Web/Database Engineer phone: (408) 525-6029
> Enterprise Line of Business pager: (408) 951-9949
Thought I didn't explain my question well. "Select *..." only gives you
each field, and if there is an array of elements in that field, it wouldn't
work for PHP as $row[field[1]], $row[field[2]], ... doesn't work.
By the way,
update tb1 set col1[2:4]='{"test","test1","test2"}';
doesn't seem to work for me. Any syntax error? Thanks again.
- Bernie