Please be gentle with me. wasn't sure whether to put this in here or in the noobs section.
I've got some code wot i wrote to insert data from dynamically generated checkboxes into my DB. It's my first try at something like this - usually Dreamweaver can do it for me...
here's the code:
<?php do {
$cat="catbox".$row_category['cat_id'];
if (isset($_POST[$cat])) {
$cat_id=$_POST[$cat];
$user_id=$_POST[uid];
mysql_query ('insert into TABLE dir_rel_cat(cat_id,user_id) VALUES ($cat_id,$user_id)');
echo $cat_id.",".$user_id."<br>";}
} while ($row_category = mysql_fetch_assoc($category)); ?>
I put the echo in for testing if the data had been passed over OK, and it all shows up just fine, but the database remains empty. the $cat variable is there to recreate the names the previous page gave to the checkboxes.