This is a snippet of code from a program I obtained. I will not insert a new record and an error message is posted. Any help is greatly appreciated.
Add the recipe to the database
if ($result = mysql_query("INSERT INTO recipes (name,servings,ingredients,instructions,description,category,added,creator,imagefile) " .
"VALUES(\"$r_name\", $r_servings, \"$ing_list\", \"$r_instructions\", \"$r_description\", $r_category, NOW(), " . $session{'userid'} . ", \"$ifilename\")"))
{
# Move the image file into place, if we need to
if ($_FILES[‘r_image’][‘size’] > 0) move_uploaded_file($_FILES[‘r_image’][‘tmp_name’], “…/images/recipes/$ifilename”);
paintform("<P CLASS=\"content\"><FONT CLASS=\"content-subheader\">Recipe Added:</FONT><BR>\n$r_name</P>\n",
"", 0, 0, array(), "", "");
c_footer();
exit();
} else {
dberror("addrecipe.php", "Cannot insert new recipe");
}
}