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:[EMAIL PROTECTED]
http://accessingram.com
> -----Original Message-----
> From: Boa Constructor [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 02, 2003 2:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Array Question
>
>
> RE: [PHP-DB] 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: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED] ; [EMAIL PROTECTED]
> Sent: Monday, June 02, 2003 8:30 PM
> Subject: RE: [PHP-DB] 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:[EMAIL PROTECTED]
> http://accessingram.com
>
>
>
> > -----Original Message-----
> > From: Boa Constructor [mailto:[EMAIL PROTECTED]
> > Sent: Monday, June 02, 2003 2:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] 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
> >
>