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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
notherand
Forum Newbie
Posts: 1
Joined: Tue Feb 23, 2010 12:55 pm

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

Post 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.
User avatar
angelicodin
Forum Commoner
Posts: 81
Joined: Fri Nov 13, 2009 3:17 am
Location: Oregon, USA

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

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