Well you've forgotten the dots when adding to the child string on the last two, and even if that worked the syntax of the mysql statment would be incorrect.
Multiple inserts are like this
INSERT INTO table (field1, field2) VALUES (value1, value2), (value3, value4)
So the best thing to do would be to tidy it all up with something like this:
$numKids = 4;
$values = array();
for ($i = 1; $i <= $numKids; $i++)
{
// create a variable to refer to the appropriate child
$childRef = 'childname'.$i;
if (!empty($_POST[$childRef]))
$values[] = "('$unique', '$_POST[$childRef]')";
}
// make sure at least one child has been filled out and string all the values together with commas
if ( count($values) )
{
$query = "INSERT INTO `child` (`ParentId` , `ChildName` ) VALUES ";
$values = implode(',', $values);
$query .= $values;
mysql_query($query);
}
You should maybe check if the insert values need escaping, too, as if somebody has name their child O'Brianna you'll get a right pain happening if you haven't got magic quotes enabled.