Insert query does't insert data to mysql database table
<p>i have a recipe table and ingredient table the primary key of both tables are auto increament and primary key of recipe is foreign key in ingredient. i post data from html to php.Note that my ingredient textboxes are generated dynamically and successfully post the data to php script. posted data is correct when i insert this data to table my query working fine but data is not added to mysql table. my code and output is </p>

<pre><code>$sql = "insert into recipe (rec_id, Name, Overview,category, Time, Image) values ('', '$name','$overview','$category','$time','$TARGET_PATH')";
    $result = mysql_query($sql) or die ("Could not insert data into DB: " . mysql_error());
        $rec_id = mysql_insert_id();</code></pre>

<p>and for ingredient </p>

<pre><code>$ingredient = $_POST['ingredient'];
$amount = $_POST['amount'];
$integer = 0;
while (count($ingredient)>$integer) {
if (($ingredient[$integer] &lt;> "") && ($amount[$integer] &lt;> "")){
$sql =  "INSERT INTO `cafe`.`ingredients` (`ingredient_id`, `ingredient_name`, `ammount`, `rec_id`,)
    VALUES ('', '".$ingredient[$integer]."', '".$amount[$integer]."', '$rec_id')";
mysql_query($sql);
echo $sql."<br/>";
}
else{
echo "ingredient number ".($integer+1)." is missing values and cannot be inserted.";
}
$integer = ($integer + 1);
}</code></pre>

<p>when i echo the queries the out put is <pre><code>nsert into recipe (rec_id, Name, Overview,category, Time, Image) values ('', 'demo recipe','no overview','meal','10/12/10 : 13:02:33','http://www.localhost/cafe/pics/demo.gif')
INSERT INTO <code>cafe</code>.<code>ingredients</code> (<code>ingredient_id</code>, <code>ingredient_name</code>, <code>ammount</code>, <code>rec_id</code>,) VALUES ('', 'ingredient one', '3gm', '29')
INSERT INTO <code>cafe</code>.<code>ingredients</code> (<code>ingredient_id</code>, <code>ingredient_name</code>, <code>ammount</code>, <code>rec_id</code>,) VALUES ('', 'ingredient two', '3gm', '29')
INSERT INTO <code>cafe</code>.<code>ingredients</code> (<code>ingredient_id</code>, <code>ingredient_name</code>, <code>ammount</code>, <code>rec_id</code>,) VALUES ('', 'ingredient three', '3gm', '29')</code></pre></p>

<p>but when i see the mysql table or retriew data from ingredient there is no data in ingredient.</p>
