I just got a web server with PHP and MySQL and for some reason when I try to send data through a form to db it gives me no error messages but nothing happens in the database. Heres the script
<?
# Sample Database Connection Syntax for PHP and MySQL.
# Connect To Database
$hostname="localhost";
$username="user";
$password="pass";
$dbname="user";
$usertable="test";
$item=$HTTP_POST_VARS[item];
$name=$HTTP_POST_VARS[name];
MYSQL_CONNECT($hostname,$username, $password) OR DIE ("<html><script language=\'JavaScript\'>alert(\'Unable to connect to database! Please try again later.\'),history.go(-1)</script></html>");
@mysql_select_db($dbname) or DIE ("<html><script language=\'JavaScript\'>alert(\'Unable to use database! Please try again later.\'),history.go(-1)</script></html>");
# Check If Record Exists
$query = "SELECT * FROM $usertable WHERE item = \'$item\'";
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result);
# Insert Record into Table
$query = "INSERT INTO $usertable (item,name) VALUES(\'$item\',\'$name\')";
$result = MYSQL_QUERY($query);
?>
That is the sample script they gave me so I cant see what the problem is