Jump to content

Recommended Posts

Hello everyone,

 

I am building a simple shopping cart but my knowledge is somewhat limited in this area. So I have a query string for storing three different data; items_name, amount and price.

 

$name_items_query_string .= '&item_name_' . $database_count . '=' . $item['name'];
		$price_items_query_string .= '&amount_' . $database_count . '=' . $item['price'];
		$qty_items_query_string .= '&quantity_' . $database_count . '=' . $item['qty'];

 

So these string contains multiple items which I need to insert to my database table but I really have no knowledge unfortunately. I am thinking maybe I will need to explode the array and store them as comma separated file but that's just a shot in the dark. If anyone could show me some directions; like a tutorial or an example, it would be great. Thank you.

I don't quite understand. Can you post up a few example data?

 

An example data would be a shopping cart with

 

item

amount

price

pants

12

20 

shirts

14

25

 

 

 

The actual string when echoed out is something like this; item id, item name, item price. (I left printing out the amount)

 

&item_name_1=Baseball Mitt&item_name_2=Soccer Ball&item_name_3=Hockey Stick
&amount_1=19.50&amount_2=25.00&amount_3=33.25

 

I hope that's what you were asking about.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.