No matter what I try I can't seem to get the data from my form into my db. This is a slightly simplified version of what I'm doing:
<?php
print_r($HTTP_POST_VARS);
$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 ('$petname','$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>
print_r($HTTP_POST_VARS); (when it's on) shows the data is THERE. It's just not getting into the db.
Please help? I've tried everything in the similar thread and in tutorials. I have plans for a neat script but I'm stuck on this basic thing.
Many thanks in advance.