That's a great idea!  Less hassle to deal with updating the defines() over
the time.  I have one little problem.  If I do the odbc_fetch_array then I
can't include two tables because of the two of the same column name.  Look
like I'll have to use one array for one table and one other array for one
other table.  Sigh!  I'm not looking forward to it because I had to update
the website to deal without the register_global and now this.  In the long
run, it will be worth it.  My boss is going to be after my hide for the time
it take to upgrade the website to work with the newer version of PHP.  Heh,
heh.  I'm going to have to change the job soon because of the poor work
policy and lousy salary.  Well, wish I can leave now but I'm not ready for
that yet.

Thanks!
 Scott F.

"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to