I want to update a table based on what a user enters. I know I got the username and password correct. But I keep getting an error based on my debugging code. I'm connecting to the database successfully, but it's just not updating. The variables print into the page, so they're not Null. What could be causing my table not to update? If this helps, I'm using Yahoo Web hosting to do this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Posted</title>
</head>
<body>
<?
$name = $_REQUEST["name"];
$date = $_REQUEST["date"];
$make = $_REQUEST["make"];
$model = $_REQUEST["model"];
$year = $_REQUEST["year"];
$rating = $_REQUEST["rating"];
$service = $_REQUEST["service"];
$conn = mysql_connect("mysql", "my_name", "my_password");
$select = mysql_select_db("Posts");
$sql = "INSERT INTO posts VALUES (NULL, \'$name\', \'$date\', \'$make\', \'$model\', \'$year\', \'$service\', \'$rating\')'";
$result = mysql_query($sql);
print "Name: " . $name . " Date: " .$date . " Make: " . $make . " Model: " . $model . " Year: " . $year . " Rating: " . $rating . " Service: " . $service . "\n\n\n\n\n\n\n\n\n";
if($conn){
print "Connected to database successfully";
}else{
print "Error!";
}
if($result){
print "Database updated";
}else{
print "Error!";
}
?>
</body>
</html>