<?php
$conn = mysqli_connect(****);
if (isset($_POST["import"])) {
$fileName = $_FILES["file"]["tmp_name"];
if ($_FILES["file"]["size"] > 0) {
$file = fopen($fileName, "r");
while (($column = fgetcsv($file, 10000, ",")) !== FALSE) {
$sqlInsert = "
insert into users (userId,userName,password,firstName,lastName)
values ("" . $column[0] . "","" . $column[1] . "","" . $column[2] . "","" . $column[3] . "","" . $column[4] . "")";
$result = mysqli_query($conn, $sqlInsert);
if (! empty($result)) {
$type = "success";
$message = "";
} else {
$type = "error";
$message = "";
}
}
}
}
?>
how to specify the starting line when reading csv with the fgetcsv method in php?