First off, system specs : MAC OSX, PHP 5 and MySQL 5.1.51
Trying something very simple and for the life of me it just won't work...
HTML Form Code: Filename : AG_test_DB.html
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>AG test</title>
</head>
<body>
<form method="post" action="add.php">
<input name="fname" type="text">
<input name="lname" type="text">
<input name="note" type="text">
<input value="Submit" type="submit">
</form>
</body>
</html>
PHP Script : Filename: add.php
<?php
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "xxxxx";
$DBName = "AG_test_DB";
$table = "info";
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$note = $_POST['note'];
echo $_POST['fname'];
echo $_POST['lname'];
echo $_POST['note'];
echo $fname;
echo $lname;
echo $note;
mysql_connect("localhost","root","xxxxx") or die(mysql_error());
mysql_select_db("AG_test_DB") or die(mysql_error());
mysql_query("INSERT INTO info VALUES('$fname','$lname','$note')");
?>
Everything is echoing just fine so I know the formdata is being passed correctly...however, nothing gets written to the db...any input would be appreciated.
- Lou