I would like to know how to insert data(could be multiple) from html table to my database table.
Like this one .

I would like to insert these data to my Order Table.
Thanks.
Moderator: General Moderators

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);