Here is the code I am using:
FORM:
<html>
<head>
<title>dbTest</title>
<body>
<form action="coffe2.php" method="post">
Coffe Name: <input type="text" name="name" value="<?php $_post['$name']?>"><br />
Roast Type: <input type="text" name="roast" value="<?php $_post['$roast']?>"><br />
Quantity: <input type="text" name="quantity" value="<?php $_post['$quantity']?>"><br />
<input type="submit" value="update"><br />
</form>
</body>
</html>
PHP:
<?php
// create connection
$connection = mysql_connect("localhost", "okami", "thedarkside")
or die("Could not make connection");
// select database
$db = mysql_select_db("coffe", $connection)
or die("Could not select database");
// create sql statement
$sql = "INSERT INTO coffe_inventory (Coffe_Name,Roast_Type,Quantity) VALUES ('$name','$roast','$quantity')";
// execute SQL statement and get results
mysql_query($sql,$connection)
or die("Could not execute query");
// print out form values
echo $_post['$name'];
echo $_post['$roast'];
echo $_post['$quantitiy'];
?>
The code is very simple, I just trying to get things to work.
If I use values instead of variables they are added to my database. I have searched for answers in many place but nothing works, I know it is probally something very easy , but I am lost.