I'm using the following code to grab my form's data and send to MYSQL:
$id=$_POST['id'];
$tag=$_POST['tag'];
$race=$_POST['race'];
$city=$_POST['city'];
$pic=($_FILES['photo']['name']);
and inserting it into my table using:
mysql_query("INSERT INTO `people` VALUES ('$id', '$tag', '$race', '$city', '$pic')") ;
My problem is that I need to allow users to enter multiple values (separated by commas or spaces) into the 'tag' field of my form to allow for multiple people to be tagged in the same image.
So I have 2 questions. First, is it best practice to create entirely new database entries for each 'bib' tag? Or would it be better to store the comma delimited list in a single column? Secondly, I have been advised to use the explode function. However, I haven't been able to figure out how to translate this into my current INSERT query. If anyone could steer me in the right direction, I'd really appreciate it. Very new to PHP and just trying to teach myself some basics.
Thanks.