I would like to know the basic method of inserting data from a field into a database......
Lets say I have a First Name text box on a form, and someone enters a name, what code do I need to send that name to the relevant table in the database??
//get user data
//validate first name -too many way here i'll leave it up to you
//open db connection
$conn=mysql_connection("localhost",$username, $password) or die ("can't connect to db because ".mysql_error());
$db=mysql_select_db($dbname) or die ("can't find db because ".mysql_error());
//create the sql -->ex below
/* text values ($var1, $var2) require single quotes around the var, numeric fields do not require quotes
field names (field1, field2) are required if not all fields are being entered
//$sql="insert into TableName ([field1, field2...fieldn] values
$sql="insert into TableName values ($'fname')";
//run the query
$result=mysql_query($sql) or die ("can't execute sql because ".mysql_error());
There more you can do, but this is the basics. Its best to get a good sql or php/mysql reference book to help you learn the basics.