Select multiple movie categories

Asked

Viewed 128 times

-3

Good, I come across the following puzzle (for me) which is the following, I sincerely know how to start doing what I want which is varios checkbox's each with its own value. Then I really don’t know how..

Attention, I’m not saying do everything to me, just give a few hints.

How can I put everything in the same column base de dados and then for example, present it in the following way on my page:

Example:

Category: Categoria1, Categoria2, Categoria3, Etc..

  • Don’t do this to me! not record multiple values in a column you will have some problems ever thought of how to query for a specific value or update? record this in a new table(associative).

  • You can help me do that?

1 answer

0

Well, an alternative is to add the selected values in an array and in PHP via foreachperform the inserts in your bank.

foreach ($categorias as $categoria) { // $categoria assume um valor do array 
        // sua inserção no banco usando $categoria
}

And to consult just perform a select of the categories.

  • What do you mean? And what would the database look like? ss

Browser other questions tagged

You are not signed in. Login or sign up in order to post.