A
Anonymous
Guest
That's because your using the ancient way of calling form variables which is both a security whole and no longer works... Try this:
Code:
<?php
$dbh = mysql_connect ("localhost", "ascendan_cat", "paws") or die ( 'I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("ascendan_pets") or die (mysql_error());
$result = mysql_query ("INSERT INTO pets (Name, Fav food) values ('".$_POST['petname']."','".$_POST['ffood']."')", $dbh);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Pet Name: <input type="text" name="petname"><br>
Favourite Food: <input type="text" name="ffood"><br>
<input type="submit" name="submit" value="Enter information">
</form>