I did not explain the problem very well. here we go again
Ok i have this SQL that inserts two vars into an art_cat table..
PHP Code:
$sql2 = mysql_query("INSERT INTO art_cat (sub_cat_id, art_id) VALUES ('$var', '$art_id')");
however, the var '$var' holds the imploded data, e.g
1_2_3_4_5
so when the data is entered into the DB, i get the following
art_id sub_cat_id
69 1_2_3_4
I would like the infor to be added like this though
art_id sub_cat_id
69 1
69 2
69 3
69 4
could someone show me how i would need to alter my SQL for this to work.
would i need a 'for each' loop according to the $var variable, then for each number, insert the art_id and number.
this would make all my other code work correctly.
thanks.