RE: Array Question

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

 



JaYup you could do that or:

$CartArray = array(
			'itemid'=>'$itemid',
			'qty'=>'$qty'
			);

That's one way, the other is what I said earlier:

$CartArray can also be multiple arrays, done thusly:
$CartArray[0]['itemid']="1";
$CartArray[0]['qty']="24";

$CartArray[1]['itemid']="2";
$CartArray[1]['qty']="32";

Now, $CartArray[0] has an itemid and a qty and $CartArray[1] does too.

Substitute the numeric subs for, say, shopping cart id's or something as
well:
$CartArray['userid1']['itemid']="1";
$CartArray['userid1']['qty']="24";

$CartArray['userid2']['itemid']="2";
$CartArray['userid2']['qty']="32";



Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"
mailto:gary.every@ingramentertainment.com
http://accessingram.com


> -----Original Message-----
> From: Boa Constructor [mailto:mickel@ntlworld.com]
> Sent: Monday, June 02, 2003 2:39 PM
> To: php-db@lists.php.net
> Subject: Re:  Array Question
> 
> 
> RE:  Array QuestionCheers Gary, and in the html would 
> I put something like:
> 
> <a href="myscript.php?itemid=1&qty=2">buy this item</a>
> 
> Simple question I know!
> 
> 
> Jay, yup thats all I want to do, just assign two values into an array.
> 
> 
> Thank you,
> 
> Graeme :)
>   ----- Original Message ----- 
>   From: Gary.Every@ingramentertainment.com 
>   To: mickel@ntlworld.com ; php-db@lists.php.net 
>   Sent: Monday, June 02, 2003 8:30 PM
>   Subject: RE:  Array Question
> 
> 
>   CartArray['itemid'] = $itemid; 
> 
>   <note> 
>   where $qty = CartArray['qty']; 
>   </note> 
> 
> 
> 
>   Gary Every 
>   Sr. UNIX Administrator 
>   Ingram Entertainment 
>   (615) 287-4876 
>   "Pay It Forward" 
>   mailto:gary.every@ingramentertainment.com 
>   http://accessingram.com 
> 
> 
> 
>   > -----Original Message----- 
>   > From: Boa Constructor [mailto:mickel@ntlworld.com] 
>   > Sent: Monday, June 02, 2003 2:27 PM 
>   > To: php-db@lists.php.net 
>   > Subject:  Array Question 
>   > 
>   > 
>   > Hello everyone.  If I wanted to pass a item ID along with a 
>   > quantity to an 
>   > associative array called "CartArray" how would I pass it to 
>   > the PHP script? 
>   > 
>   > I'll get this shopping cart working yet !! 
>   > 
>   > Cheers, 
>   > 
>   > Graeme :) 
>   > 
>   > 
>   > -- 
>   > 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