Modify $roll_array[]
and make it a string as follow:
$roll_string = '';
for($i=$roll_number_start; $i<=$roll_number_end; $i++)
{
$roll_number = $roll_number_format.$i;
$p_username = generatePassword();
$p_password = generatePassword();
$roll_string .= "('".$roll_number."',"."'".$student_class."',"."'".$class_section."',"."'".$batch_year."',"."'".$p_username."',"."'".$p_password."'),"
}
$roll_string = substr($roll_string, 0, -1);
$insert_sql = "INSERT INTO student (roll_number, student_class, class_section, batch_year, p_username, p_password) VALUES ".$roll_string;
4
solved multiple row entry in phpmyadmin using for loop [closed]