vendredi 23 octobre 2015

Storing array to SQL database

I am trying to store a wishlist. I am storing the id of the product it in a column named wish. I want to add the id of each item selected by the user into the column wish in a table named store.

Eg:

_______________________

id |    name    | wish
_______________________

1       John      752
                  885
                  329
_______________________

2       Adam      228
                  985
_______________________

This is what I want to do. Those numbers in the column wish are the product id's of different products the user has added to the wishlist. I want to input to id's like this to my SQL database and later access each of those independently and display the details of products with that id on a page.

How can I store id's like this?




Aucun commentaire:

Enregistrer un commentaire