best thing to do is find a script on hotscripts.com that sends data from a form, and posts it to a mysql database.. you can usually see what they are doing, and t hen just copy the code and rewrite it however you need.
however, you are still gonna need a basic understanding of how to use function calls within php to mysql.. and to the $_POST form data..
here is a quick easy/short little example to do what you are wanting though :
page_1.htm
Code: Select all
<html><head><title>bob</title></head>
<body>
<form method="POST" action="go.php">
Enter a name : <input type="text" name="full_name">
<br>
<input type="submit" value="submit" name="submit">
</form>
</body>
</html>
go.php
Code: Select all
<?php
if(!isset($_POST['full_name']))
{
echo 'You must enter a name before we can proceed... Please Try again.';
exit;
}
$name = $_POST['full_name'];
mysql_connect('localhost','username','password') or die(MySQL_Error());
mysql_select_db('my_db_name') or die(MySQL_Error());
$sql = "INSERT into mytable (name) values ('".$name."')";
$result = mysql_query($sql) or die(MySQL_Error());
echo $name.' successfully added to Table.';
mysql_close;
?>
of course this may not work as you need it to, but you get the idea... just kinda wrote it up real quick for ya.
anyways, here are some links of interest you need to definately check out :
http://www.hotscripts.com - Great source for pre-written scripts of all kinds
http://www.evilwalrus.com - Same as Hot Scripts
http://www.php.net/mysql - Starting block to understanding all the possible mysql functions used in php
http://www.google.com - Your and My #1 stop for questions... type in a question, press search, generate results. can't go wrong
hope this helps.
edit : may also want to check out the MySQL Manual as well... When you downloaded mysql, it includes a Manual in the directory in which you installed it. Otherwise, just check out MySQL's website. They have an online manual there as well.