Another PHP question...please help..

dezell123

Banned
Dec 14, 2000
554
0
0
It might seem like I'm stupid with all these PHP questions,but I'm not :D

Well,here's the question.

I have a form. And when I submit it,I wanna add the form's contents to the datbase. How do I do this?

I am using MySQL BTW.

Thanks for anyone who helps me.
 

purplehayes

Golden Member
Mar 31, 2000
1,517
0
0
$sql = "INSERT INTO yourtablename (your, column, names) VALUES '$your', '$form', '$data')";

$dbh=mysql_connect ("localhost", "youraccount", "password") or die ('I cannot connect to the database.');

mysql_select_db ("your_database");

$sql_result = mysql_query($sql)
or die("Couldn't execute query.");

Enjoy!

PH
:D
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
you are freakin lazy! im sure there are about a 1000 articles on the net that tell you how to do it.