Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End how to insert multiple rows in one table Re: how to insert multiple rows in one table

#72964
The-Marshal
Member

I tried this and work with me


include"config.php";

/*
CREATE TABLE `multiple` (`m_id`,`m_name`,`m_email`);
*/

if($_REQUEST){
$name = $_POST;
$email = $_POST;

$name1 = $_POST;
$email1 = $_POST;

$name2 = $_POST;
$email2 = $_POST;

$SQL = "INSERT INTO multiple ";
$SQL .= "(`m_name`, `m_email`) ";
$SQL .= "VALUES ";
$SQL .= "('$name','$email'), ";
$SQL .= "('$name1','$email1'), ";
$SQL .= "('$name2','$email2')";

$Query = mysql_query($SQL) or die(mysql_error());

if($Query){
echo"

MULTIPLE INSERT IS DONE !

";
}
}


?>

First Name:



First Email:




Second Name:



Second Email:




Third Name:



Third Email:






but in need it more dynamically

like in array when i make form through this form can add more records by JQuery such




and dynamically add the values of this records in the mysql table ??