Problem with a loop
Posted: Sun Jan 08, 2006 6:21 pm
Hi,
Having a problem with the following;
Does anybody know why the insert query wont work with inner statement included.
Thanks
Will
Having a problem with the following;
Code: Select all
$last_id = mysql_insert_id();
$type_count = count($types);
for ($i=0; $i < $type_count; $i++) {
$match = "";
if ($types[$i] == $featured[$i]) {
$match = "y";
}
$q_add_types = "INSERT into company_ins (Id, company_id, ins_id, type_featured) VALUES ('', '$last_id', '$types [$i]', '$match')";
mysql_query($q_add_types) or die(mysql_error());
}Thanks
Will