Creating forms have a MySQL question

ghaynes

Member
Mar 1, 2002
81
0
0
Client of mine would to create a simply section on her site to input client information. I can create the form for her to enter but I need help with storing the data. I know I need to create a mySQL db using my hosts cpanel, and I started playing with it and starting creating fields but how do I save all the data that the user enters into the db. Bascially how do I connect to the db using Dreamweaver MX.

I just need some simple steps on setting the db up and having the data stored. Thanks in advance.
 

ghaynes

Member
Mar 1, 2002
81
0
0
I created a simply form with one textbox and a submit button. The database has been created with 2 fields with one field as an autonumber and the other a simply text field. The code is below with the form and so how do I have the text box assign to the field in my table. Do I need to write an SQL statement on website? If so how do assign an sql statement to the submit button.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>
<?php
$dbh=mysql_connect ("localhost", "rh1447_ghaynes", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("rh1447_contact");
?>

<form name="form1" method="post" action="">

<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>
</body>

</html>