Jump to content

Form data to sql problem


s0niC

Recommended Posts

Hi you experts !

I'm having trouble with the following code :

On a page, a customer can select items wich he wants to buy. He also can fill in the number of items he wants. so it looks like this :

-----------------------------------------------------------------------------------------------
| ITEM 1 | (hidden field with item_id[] as value) | input textbox (name = count[]) |
-----------------------------------------------------------------------------------------------
| ITEM 2 | (hidden field with item_id[] as value) | input textbox (name = count[]) |
-----------------------------------------------------------------------------------------------
| ITEM 3 | (hidden field with item_id[] as value) | input textbox (name = count[]) |
-----------------------------------------------------------------------------------------------


So when the user selects multiple items, i get two arrays when he pushes the send button -->

item_id = array one that contains all the item id's
count = array two that contains all the number of items the customer orders.

But now, i want to insert these numbers in the database. I allready tried with exploding the arrays, but it will not work. The SQL i need to use looks like this :

INSERT count_items INTO TABLE_NAME WHERE itemid = item_id AND client = client_id (also a hidden field but this ones easy)

Ok, for my first message its rather difficult i think, but i really hope someone can help. Other options to do this are always welcome....
Link to comment
Share on other sites

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.