<?php include 'recipe2db.php' ?>

<div align="left"><img src="Cookie Banner edited.jpg" width="1100" height="200" />
<form name="form7" method="post" action="add_process.php">
  <table align="center" border="3" cellpadding="2" cellspacing="2"> 
  <td>catagory	:</td>
include 'recipe2db.php';

$query="SELECT id_category, category_name FROM category";

$result = mysql_query ($query);
echo "<select name=category value=''></option>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id_category]>$nt[category_name]</option>";
/* Option values are added by looping through the array */
echo "</select>";// Closing of list box
  <td>recipe name	:</td>
    <td><input name="name" type="text" maxlength="100"></td>
  <td>ingredient	:</td>
  <td><textarea name="ingredient" cols="100" rows="20"></textarea></td>
  <td>cooking instruction	:</td>
  <td><textarea name="cooking_ins" cols="100" rows="20"></textarea></td>
  <td align="center"><p>&nbsp;
      <input type="submit" name="btnadd" value="ADD" >
      <input type="submit" name="cancel" value="cancel" >



<?php include 'recipe2db.php' ?>


$sql="INSERT INTO recipe(name, ingredient, cooking_ins,id_category)VALUES('$name', '$ingredient', '$cooking_ins','$category')";

echo "Successful";
echo "<BR>";
echo "<a href='home.php'>HOME/a>";

else {
echo "ERROR";


i use this interface to insert the data, but it cannot save in the database.
can somebody help me.

first thing it did you insert a row manually through phpmyadmin.

i had a problem with it not working cause there was not a row in there to begin with.
code looks fine

This question has already been answered. Start a new discussion instead.