lundi 18 septembre 2017

Codeigniter checkbox insert depends on what is checked

I have search this kind of problem and i know how to insert data using checkbox but this one is different because I looped the data(players) in the database so my problem is how to insert the result that are checked in the database.

View Code:

php foreach($playerlist as $players)

input type="checkbox" name="players[]" value="player_fname

php endforeach;

The output is this

And any advice what is good to insert this data
Column_Players
id 1:|player1,player2,player3 |

Or


Column_Players
id1: |player1 id2: |player2 id3: |player3




Aucun commentaire:

Enregistrer un commentaire