Hey guys I have been looking at this code now for a few days around doing other things and I still cant find out why it is not inserting into the mysql database.
<html>
<head>
<?
include("./db_connect.php");
$db = new connection();
$db->connect();
$username = $_POST['username'];
$catagory = $_POST['catagoryName'];
$catagoryDesc = $_POST['catagoryDescription'];
?>
</head>
<body>
<form name="completed" action="admin.php" method = "POST">
<?
echo "->".$catagory;
echo $catagoryDesc;
if(($catagory == '') || ($catagoryDesc == ''))
{
echo "Did not recieve catagory name or description - update FAILED<br>";
}
else
{
echo "Catagory: ".$catagory."<br>";
echo "Catagory Description: ".$catagoryDesc."<br>";
$query = "INSERT INTO catagory (name,desc) VALUES ('$catagory', '$catagoryDesc');";
echo $query."<BR>";
mysql_query($query) or die('Error - Could not insert catagory into the database');
}
$db->close();
?>
<input type="hidden" name="username" value="<? echo $username; ?>">
</form>
<script type='text/javascript'>
alert("Group <? echo $catagory; ?> as been added to the database");
document.completed.submit();
</script>
</body>
</html>