我想在一条指令中输入从 for 循环生成的 100 行。我正在使用以下内容,但它不起作用。
for($i=$roll_number_start; $i<=$roll_number_end; $i++)
{
$roll_number = $roll_number_format.$i;
$p_username = generatePassword();
$p_password = generatePassword();
$roll_array[] = " ('".$roll_number."',"."'".$student_class."',"."'".$class_section."',"."'".$batch_year."',"."'".$p_username."',"."'".$p_password."')";
}
$insert_sql = "INSERT INTO student (roll_number, student_class, class_section, batch_year, p_username, p_password) VALUES".$roll_array;
你能建议我如何使用一条指令插入 mysql 吗?