I was wondering if its possible to use multiple insert query in a single php code. Like when I clicked the save button. My php code will perform multiple insertion on a same table? Is it possible?
Example: tb_people with field 'id','name'
I have 3 name inputs that I need to put a value if a click the save button it will save?
Example code:
<?php
if(isset($_POST['save']))
{
$name1 = $_POST['name1'];
$name2 = $_POST['name2'];
$name3 = $_POST['name3'];
mysql_query("INSERT into tb_people(name) VALUES ('$name1')");
mysql_query("INSERT into tb_people(name) VALUES ('$name2')");
mysql_query("INSERT into tb_people(name) VALUES ('$name2')");
}
?>
Is this possible? I'm curios cause im planning to use this kind of idea.