Simple Input Form
Posted: Sun Jun 18, 2006 5:43 pm
Hi, trying to create my first input form (Below)
This passes the entered values into inputcat.php
I get the "You have just entered this record" with the values I typed in on the input form.
But when I query the "category" table the record isn't entered?
I have error reporting on "ALL" but no errors are displayed.
Thanks
Geoff
Code: Select all
<head>
</head>
<center>
<form method="post" action="inputcat.php">
<table>
<tr><td align="left">Catagory</td>
<td><input type="text" name="category"></td>
<tr><td align="left">cat_id</td>
<td><input type="text" name="cat_id"></td>
<tr><td colspan="2">
<p align="center">
<input type="submit" value="Enter New Catagory">
</td>
</tr>
</table>
</form>
</center>
</html>Code: Select all
<?
error_reporting(E_ALL);
include 'upload2/config.php'; //Connect to DB etc
include 'upload2/opendb.php';
$category=$_POST['category'];
$cat_id=$_POST['cat_id'];
$sqlquery = "INSERT INTO category VALUES('$category', '$cat_id')";
$results = mysql_query($sqlquery);
mysql_close();
print "<html><body><center>";
print "<p>You have just entered this record<p>";
print "Category : $category<br>";
print "ID : $cat_id<br>";
print "</body></html>";
?>But when I query the "category" table the record isn't entered?
I have error reporting on "ALL" but no errors are displayed.
Thanks
Geoff