I'm using foxserv for all my develpment. I'm new to php and in the process of learning as I go. I have this script that is suppose to process my form and send it to a mysql database. I'm just getting this one little error and I don't see the problem. It's saying that I have to many $ on line 25. Here is my code. For the life of me I can't see the problem. And as i said before I'm new to php so I don't even know if this is the right way to send form results to a database.
PHP Code:
<html>
<head>
<title>Data Handle</title>
<meta http-equiv="Content-Type" content="text/html"; charset=iso-8859-1">
</head>
<body>
<?php
// Include the MySQL class
require_once 'database_mysql.php';
$host= 'localhost'; // Hostname of MySQL server
$dbUser= 'xxxxxxx'; // Username for MySQL
$dbPass= 'xxxxxxxxxxx'; // Password for user
$dbName = 'computerlab'; // Datbase name
// Connect to MySQL
$db = &new MySQL($host, $dbUser, $dbpass, $dbName);
$sql = "INSERT INTO labtable VALUES ('".$_POST['date']."', '".$_POST['grade']."', '".$_POST['teacher']."', '".$_POST['resource']."',
'".$_POST['res_use']."', '".$_POST['elapsed_time']."');
?>
</body>
</html>
Comment