Re: Re: odbc_fetch_into ??
| From: | Scott Fletcher | Date: | Tue, 02 Jul 2002 15:59:59 +0000 |
| Subject: | Re: Re: odbc_fetch_into ?? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104951@lists.php.net to get a copy of this message | ||
That function, odbc_fetch_array() does not work. PHP spit out the error,
undefined function.
"Analysis & Solutions" <danielc@analysisandsolutions.com> wrote in message
news:20020702144849.GB12581@panix.com...
> Scott:
>
> On Tue, Jul 02, 2002 at 10:05:31AM -0400, Scott Fletcher wrote:
> > I tried this script and it showed all of the data correctly, so how do I
> > make the define variable to work correctly?
> >
> > > define(CUSTOMER_ID,0);
> > > define(CUSTOMER_NAME,1);
> > > define(STATE,6);
> > >
> > > // blah blah blah
> > >
> > > if (odbc_fetch_row($result))
> > > {
> > > odbc_fetch_into($result,$user_detail,1);
> > > {
> > > echo $user_detail[STATE];
> > > }
> > > }
>
> Why not make life simpler via odbc_fetch_array()? The names of the fields
> become the names of the array's keys. Drop the defines() and
> odbc_fetch_row() and just do this:
>
> while ( $user_detail = odbc_fetch_array($result) ) {
> echo $user_detail['State'];
> }
>
> --Dan
>
> --
> PHP classes that make web design easier
> SQL Solution | Layout Solution | Form Solution
> sqlsolution.info | layoutsolution.info | formsolution.info
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409