CREATE TABLE test (
id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name VARCHAR( 100 ) NOT NULL ,
address VARCHAR( 100 ) NOT NULL
) ENGINE = InnoDB
If that's my table, and I have a form with 2 fields name and address, this is how I would be inserting the values to the table test. This should get you started.(I hope!)
<?php
if(isset($_POST['submit'])){
$conn=mysql_connect("localhost","root");
mysql_select_db("exact");
$name=$_POST['name'];
$address=$_POST['address'];
$query="INSERT INTO TEST (ID,NAME,ADDRESS) VALUES ('','$name','$address')";
mysql_query($query);
}
?>
<html>
<body>
<form method="post" action="insert_example.php">
Enter Name: <input type="text" name="name"><br />
Enter Address: <textarea rows="10" cols="20" name="address"></textarea>
<br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Cheers,
Nav
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*