Hi Guys & Girls
I have this table:
$sql = "CREATE TABLE " . $Name . "(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
ItemName VARCHAR(30) NOT NULL,
ItemWeight VARCHAR(30) NOT NULL,
ItemPrice VARCHAR(5),
ItemDate DATE
)";
& This Query:
$sql = "INSERT INTO Pantry (ItemName, ItemWeight, ItemPrice, ItemDate)
VALUES (" . $Name . ", " . $Weight . ", " . $Price . ", " . $Date . ")";
& the response I get is:
Error Updating table: Unknown column 'Bacon' in 'field list'.
I believe this to be an SQL issue but I don't know what or why. the HTML and PHP is below relating to this:
if (isset($_POST["Item"])){
Add_Item($_POST["Item"], $_POST["Weight"], $_POST["Price"], $_POST["Date"]);
}else{
echo "Nothing To do";
}
<body>
<form action="ActionPage.php" method="POST">
<input type="button" value="Create Pantry" onclick="CreatePantry()" />
<label for="PantryID">Create Pantry: </label>
<input type="text" id="PantryID" name="PantryID" disabled="true" />
<input type="button" value="Add Item" onclick="AddItem()" />
<label for="ItemName">Item Name: </label>
<input type="text" id="Name" name="Item" />
<label for="ItemWeight">Item Weight: </label>
<input type="text" id="Weight" name="Weight" />
<label for="ItemPrice">Item Price: </label>
<input type="text" id="Price" name="Price" />
<label for="ItemDate">Item BBE: </label>
<input type="text" id="Date" name="Date"/>
<input type="Submit" Value="Submit" />
</form>
</body>
Any help would be appreciated.