I\'m new to PHP/MySQl and i\'m trying to enter data into a db. It keeps giving me error\'s saying the form vaules are not defined.
Here is the PHP file:
<?php
$host = "localhost";
$username ="root";
$password ="TheDBPassword";
$database ="mydb";
mysql_connect($host,$username,$password) or die( "<br><center>Unable to connect to database server</center>");
@mysql_select_db($database) or die("<br><center>Unable to select to database</center>");
// Line 13 is the line below
$query = "INSERT INTO employees VALUES ("$first","$last","$address","$position")";
mysql_query($query);
mysql_close()
?>
Here is the Form File
<html>
<body>
<form action="test14.php" method="post">
First: <input type="text" name="first"><p>
Last: <input type="text" name="last"><p>
Address: <input type="text" name="address"><p>
Position: <input type="text" name="position"><p>
<input type="submit"><p>
</form>
</body>
</html>
The Error Messages i get:
(With quotes around value example: \"$first\")
Parse error: parse error in /Library/WebServer/Documents/test14.php on line 13
or
(Without quotes around value example: $first)
Notice: Undefined variable: first in /Library/WebServer/Documents/test14.php on line 13
Notice: Undefined variable: last in /Library/WebServer/Documents/test14.php on line 13
Notice: Undefined variable: address in /Library/WebServer/Documents/test14.php on line 13
Notice: Undefined variable: position in /Library/WebServer/Documents/test14.php on line 13
Anything will help,
Thanks K