Re: php array question

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

 



Hi Ben,
I tried your portion of code and find out what was wrong... Apparently I
used & in adding order to the array and that was messing things up...
Everything is working now.
Thanks for all the help!!!!


"Victor C." <cao117@xxxxxxxxxxx> wrote in message
news:20041101215701.76057.qmail@xxxxxxxxxxxxxxx
> I did a print_r(array_values)    before calling the codes that had errors
in
> it.. the following content is contained in $this->orders;
>
> Array ( [0] => order Object ( [UserObject] => user Object ( [UserID] =>
> E2401 [Pass] => [IsValid] => 1 [UserType] => AT [fonthtml] => [footerfile]
> => resources/footer.php [headerfile] => resources/header.php [Email] =>
> testemail@xxxxxxxxxxxxxxxx [FirstName] => Dennis [LastName] => 5
> [Salutation] => [Phone] => 123-456-7890 [Fax] => 321-123-4567 [Address1]
=>
> 555 Testing Avenue [Address2] => Test 200 [City] => Orlando [State] => FL
> [Zip] => 12345 [DisplayName] => 52II Rfc [Region] => WEST [OSJ] => 1
> [Series7] => 1 [OSJAddress1] => Changed 9:55 Am [OSJAddress2] => [OSJCity]
> => Des Moines [OSJState] => IA [OSJZip] => 4444 [OSJPhone] => 43143431214
> [existsindb] => 1 [firsttime] => 1 ) [OrderID] => 392 [CartID] => 90
> [TemplateID] => 1 [UserID] => E2401 [completed] => 1 [ordername] => 4312
> [existsindb] => 1 [cost] => 3665.2 [totalcopies] => [directmailquantity]
=>
> [directshippingmethod] => [overprintquantity] => 4312
> [overprintshippingmethod] => [rushoption] => Standard [dl1000instancefile]
> =>
> 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
> J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
> 9:55 Am, Des Moines, IA,
>
4444|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
> gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
> InterSecurities, Inc. Member NASD, SIPC and Registered Investment
> Advisor|Changed 9:55 Am, Des Moines, IA,
4444|C:/Inetpub/wwwroot/printsite/
> [flashvars] => 0||0||0|0|341431|Enter your
> company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,
>
4444||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
> wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
> NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
> IA, 4444| [dbname] => [dbpath] => [age] => [zip] => [gender] => [income]
=>
> [home] => [homevalue] => [length] => [children] => [childrenAge] =>
> [marital] => [networth] => [stock] => [listquantity] => )
>
> [1] => order Object ( [UserObject] => user Object ( [UserID] => E2401
[Pass]
> => [IsValid] => 1 [UserType] => AT [fonthtml] => [footerfile] =>
> resources/footer.php [headerfile] => resources/header.php [Email] =>
> testemail@xxxxxxxxxxxxxxxx [FirstName] => Dennis [LastName] => Cunningham
> [Salutation] => [Phone] => 123-456-7890 [Fax] => 321-123-4567 [Address1]
=>
> 555 Testing Avenue [Address2] => Test 200 [City] => Orlando [State] => FL
> [Zip] => 12345 [DisplayName] => Dennis J. Cunningham II Rfc [Region] =>
WEST
> [OSJ] => 1 [Series7] => 1 [OSJAddress1] => Changed 9:55 Am [OSJAddress2]
=>
> [OSJCity] => Des Moines [OSJState] => IA [OSJZip] => 4444 [OSJPhone] =>
> 43143431214 [existsindb] => 1 [firsttime] => 1 ) [OrderID] => 392 [CartID]
> => 90 [TemplateID] => 1 [UserID] => E2401 [completed] => 1 [ordername] =>
> 4312 [existsindb] => 1 [cost] => 3665.2 [totalcopies] =>
> [directmailquantity] => [directshippingmethod] => [overprintquantity] =>
> 4312 [overprintshippingmethod] => [rushoption] => Standard
> [dl1000instancefile] =>
> 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
> J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
> 9:55 Am, Des Moines, IA,
>
4444|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
> gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
> InterSecurities, Inc. Member NASD, SIPC and Registered Investment
> Advisor|Changed 9:55 Am, Des Moines, IA,
4444|C:/Inetpub/wwwroot/printsite/
> [flashvars] => 0||0||0|0|432141 II Rfc|Enter your
> company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,
>
4444||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
> wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
> NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
> IA, 4444| [dbname] => [dbpath] => [age] => [zip] => [gender] => [income]
=>
> [home] => [homevalue] => [length] => [children] => [childrenAge] =>
> [marital] => [networth] => [stock] => [listquantity] => ) )
1Object<--value.
>
>
> 391<--OrderID.
> 392<--going crazy
> Object<--value.
> 392<--OrderID.
> 392<--going crazy
>
>
>
> "Ben Ramsey" <lists@xxxxxxxxxxxxx> wrote in message
> news:4186B023.4000908@xxxxxxxxxxxxxxxx
> > Ben Ramsey wrote:
> > > Victor C. wrote:
> > >
> > >>     $OrderObject =$this->orders[$OrderID=>$value];
> > >
> > >
> > > This line is confusing. $OrderID=>$value is either a typo or is just
> > > plain wrong. It looks like what it's meant to say is:
> > >
> > > $OrderObject = $this->orders[$OrderID];
> > >
> > > But this will just set $OrderObject equal to $value, so you should
just
> > > use:
> > >
> > > $OrderObject = $value;
> > >
> > > Try that and see if it works.
> > >
> >
> > Nevermind. I read that wrong. $this->orders is an array of objects, like
> > you said, which I glanced over too quickly.
> >
> > My statement above still holds, though. $this->orders[$OrderID=>$value]
> > still appears to be a typo to me. It might supposed to be:
> >
> > $OrderObject = $this->orders[$OrderID]
> >
> > which will return the order object at $OrderID location in the array
> > ($OrderID being the array key).
> >
> > Then, $OrderObject->OrderID should work properly.
> >
> > However, I would think that
> >
> > echo $OrderObject->OrderID;
> >
> > should produce the same results as
> >
> > echo $OrderID;
> >
> > But I could be wrong since I'm not exactly sure how the order object
> looks.
> >
> > Perhaps doing a var_dump on the $this->orders would help us out?
> >
> > --
> > Ben Ramsey
> > Zend Certified Engineer
> > http://benramsey.com
> >
> > ---------------------------------------------------
> > Atlanta PHP - http://www.atlphp.org/
> > The Southeast's premier PHP community.
> > ---------------------------------------------------

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux