I have two tables in one DB,
tbl_language: tbl_users lang_id lang_name user_id user_name user_lang 1 English 2 Spanish 3 German 4 Portuguese
I have PHP code to select languages from tbl_lang, Now I have a multiple select in a form where users can choose more than one languages. While inserting the values in database, I want to store multiple language values in one column/attribute. Where user_lang attribute would only store lang_ids of the tbl_language separated by comma(,).
Like
tbl_users: user_id user_name user_lang 1 ABC 1,2 2 XYZ 1,4
How to accomplish this using PHP and MySQL ?
I have sample code here:
<?php
$user_name = $_POST['user_name'];
$user_lang = $_POST['user_lang']; // user_lang as array from multiple select
$qry = ""; // I need help with this query