Hey everyone,
I'm new to PHP, and to MySQL. I want this script to allow me to input a
value from a form (name) into a MySQL table (test table in test
database). Here's the form:
<form action="sql.php" method="POST">
Name:<input type="text" name="name" maxlength="10">
<br /> <input type="submit" name="submit" value="Submit Data">
And here's sql.php:
<?php
// Make a MySQL Connection
mysql_connect("localhost", "*****", "*****") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
$name=$_POST['name']
// Insert a row of information into the table "films"
mysql_query("INSERT INTO test
(name) VALUES('$name') ");
or die(mysql_error());
echo "Data Inserted!";
?>
Any help would be greately appreciated!