Re: works under mysql 5 but not under Oracle 11g1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





--- On Mon, 11/24/08, Fred Silsbee <fredsilsbee@xxxxxxxxx> wrote:

> From: Fred Silsbee <fredsilsbee@xxxxxxxxx>
> Subject: Re:  works under mysql 5 but not under Oracle 11g1
> To: "Chris" <dmagick@xxxxxxxxx>
> Cc: php-db@xxxxxxxxxxxxx
> Date: Monday, November 24, 2008, 10:31 PM
> --- On Mon, 11/24/08, Chris <dmagick@xxxxxxxxx> wrote:
> 
> > From: Chris <dmagick@xxxxxxxxx>
> > Subject: Re:  works under mysql 5 but not
> under Oracle 11g1
> > To: fredsilsbee@xxxxxxxxx
> > Cc: php-db@xxxxxxxxxxxxx
> > Date: Monday, November 24, 2008, 10:00 PM
> > > fixed the problem but am not fully sure of the
> optimum
> > code one should use!
> > > 
> > > I like the association idea but must change the
> > $fields array
> > > 
> > > There is a better way than using count!
> > > 
> > > 67     //get log_book_id table information
> > >      68     $user = "select * from
> > log_book_id";
> > >      69     $result = oci_parse($conn, $user);
> > >      70         $r = oci_execute($result);
> > >      71
> > >      72     //display log_book_id information
> > >      73
> > >      74     while ($newArray =
> oci_fetch_row($result))
> > {
> > >      75 //      print_r($newArray);
> > 
> > What does line 75 show and what do you expect it to
> show?
> > 
> > 
> > >      85         //note that we do not rely on the
> > checkbox value as not all browsers submit it
> > >      86         //instead we rely on the name of
> the
> > checkbox.
> > 
> > Well, that's wrong. The value is submitted IF the
> > checkbox is ticked. If it is not ticked, it is not
> submitted
> > (this is the same in any language, it's not a php
> > specific thing).
> > 
> > -- Postgresql & php tutorials
> > http://www.designmagick.com/
> 
> Array ( [LOG_ID] => 405 [FDATE] => 15-JUL-01 [ACTYPE]
> => C172 [ACID] => N17SJ [NLANDINGS] => 1 [NHOURS]
> => 1.2 ) 
> 

You will not beleiev this!

That great print_rt tip you gave me showed upper case keys in the association.....so

74     $count = 0;
     75     while ($newArray = oci_fetch_assoc($result)) {
     76         if ($count == 0)        print_r($newArray);
     77     $count = 1;
     78         foreach ($fields as $field){
     79 $fieldx = strtoupper($field);                 fixed   <<<<<<<<<<<<<
     80             ${$field} = $newArray[$fieldx];
     81                 $count = $count +1;
     82 //              print($field);
     83 //              print_r($newArray[$field]);
     84         }
Not using count!


      


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux