$conn = mysql_connect("localhost", "root", '111111', false, 65536)or die(mysql_error());
$studentName = array("Rahul", "Ravi", "Sachin", "Vikas","Sunidhi");
foreach($studentName as $value){
$query_arr[] = "(NOW(),NOW(),$value)";
}
$bulk_ins_qry = "INSERT INTO tbl_student (creationdate,lastupdate,name)
VALUES";
$bulk_ins_qry .= implode(",",$query_arr);
mysql_query($bulk_ins_qry, $conn);
No comments:
Post a Comment