I have a database with 3 fields id, article, category.
There are a series of input boxes for article name and a corresponding select box for category. I am trying to write the article name and the category to a record for each group.
Here is the array info:
Array (
[article] =>
Array (
[0] => Black Plaid Western Shirt
[1] => Dogfish Head T-shirt
[2] => Old Navy Bootcut Jeans
[3] => Cowboy Boots )
[category] =>
Array (
[0] => Dress Shirt
[1] => T-Shirt
[2] => Jeans
[3] => Footwear )
)
And here is my insert statement:
foreach ($_POST['wardrobe'] as $key => $value) {
$sql = "insert into worn(userid,eventid,article,category) values('$userid','$eventid','".$value['article']."','".$value['category']."')";
$result = mysql_query($sql);
}
Thanks.