Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses ) Array ( [0] => Array ( [itemcd] => daisys
[itemcat] => FL [itemdesc] => Daisys, seed package 200/250 cnt [unitprice]
=> 2.2 ) [1] => Array ( [itemcd] => gerainiums
[itemcat] => FL [itemdesc] => Gerainiums, purple, seed package 25/30 cnt
[unitprice] => 0.85 ) [2] => Array ( [itemcd] =>
roses [itemcat] => FL [itemdesc] => Rose, white, root clump bush - spring
delivery [unitprice] => 35 ) [3] => Array (
[itemcd] => tomatoe [itemcat] => VG [itemdesc] => Tomatoe, Super-Burbee,
seedling flat, 12 plants [unitprice] => 12.5 ) [4]
=> Array ( [itemcd] => cucumber [itemcat] => VG [itemdesc] => Cucumber seed
package, Chyrnobyl hybrid cross 10cnt
[unitprice] => 0.03 ) [5] => Array ( [itemcd] => habanero [itemcat] => HP
[itemdesc] => Red Savina Habanero Pepper
seeds -- 20cnt, not for export [unitprice] => 2.85 ) [6] => Array ( [itemcd]
=> snapdragon [itemcat] => FL [itemdesc] =>
Snap Dragons, yellow/orange mix, seed package 50cnt [unitprice] => 1.25 )
[7] => Array ( [itemcd] => tulip [itemcat] => FL
[itemdesc] => Tulip bulbs ... spring delivery 8 sets [unitprice] => 42.5 )
[8] => Array ( [itemcd] => snappea [itemcat] => VG
[itemdesc] => Sugar snap peas - seed package 25 count [unitprice] => 2 ) [9]
=> Array ( [itemcd] => marigold [itemcat] =>
FL [itemdesc] => Marigold - Traditional ... seed package 40 cnt [unitprice]
=> 3.15 ) [10] => Array ( [itemcd] => bellpepper
[itemcat] => VG [itemdesc] => Green Bell Pepper - Sweet, seed package 30 cnt
[unitprice] => 4 ) [11] => Array ( [itemcd]
=> tigerlilly [itemcat] => FL [itemdesc] => Tiger Lilly seedlings 10cnt
[unitprice] => 5.2 ) [12] => Array ( [itemcd] => pequin
[itemcat] => HP [itemdesc] => Pequin ornamental hot pepper seed, 150 count
[unitprice] => 4.25 ) [13] => Array ( [itemcd]
=> seranno [itemcat] => HP [itemdesc] => Seranno Pepper - spicy! seed pack
42cnt [unitprice] => 1.25 ) [14] => Array (
[itemcd] => flamingo [itemcat] => LO [itemdesc] => Tacky plastic pink
flamingo, each [unitprice] => 5.23 ) [15] => Array (
[itemcd] => stork [itemcat] => LO [itemdesc] => Tacky plastic stork,
alienate the new mom! each [unitprice] => 7.25 ) [16]
=> Array ( [itemcd] => rabbit [itemcat] => LO [itemdesc] => Plastic lawn
rabbit, multiplies less than real, each [unitprice] =>
4.05 ) [17] => Array ( [itemcd] => barney [itemcat] => LO [itemdesc] =>
Barney the Giant Purple Dinosaur, take him please!
[unitprice] => 0.25 ) [18] => Array ( [itemcd] => gargoyle [itemcat] => LO
[itemdesc] => Gargoyle, plaster, for the goth in us
all! [unitprice] => 25 ) )

-----Original Message-----
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:33 PM
To: '[EMAIL PROTECTED]'; Php
Subject: RE: [PHP] beginner in PHP


send the results of putting these two line just before your while loop
print_r($mycart);
print_r($catalog);

-----Original Message-----
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:31 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Thanks, but that didn't work either

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys in an
array.
$catalog["itemcd"]
$catalog["unitprice"]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but
nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
>         {
>         if ($value == $catalog[itemcd])
>                 {
>
>                         echo $catalog[unitprice];
>
>                 }
>         }
>
>
>Thanks
>
>Phil
>

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



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

Reply via email to