Page 1 of 1

Insert html table data to database table.... (newbie)

Posted: Tue Feb 23, 2010 1:10 pm
by notherand
Hi guys ,
I would like to know how to insert data(could be multiple) from html table to my database table.
Like this one .
Image

I would like to insert these data to my Order Table.

Thanks.

Re: Insert html table data to database table.... (newbie)

Posted: Tue Feb 23, 2010 2:41 pm
by angelicodin
Question: Where is the information coming from?

also, to do this you can just make a php/sql querry and run it. Here is an example, but might not apply to what you are doing:

Code: Select all

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$name = $_POST['name'];
// Insert data into mysql
$sql = "INSERT INTO `tablename` (`id`, `name`) VALUES (NULL , '".$name."');";
$result=mysql_query($sql);