Q:

PHP Why the imported csv file only insert the first row of csv to SQL

Let's say I have 3 row in the .csv file with 3 column. In that case I need to import the exact same file for 3 times to get all my data in the .csv file to completely inserted into my SQL database. I thought !feof($file) should make sure the looping through the end of file? 
if (isset($_POST['submitI'])){
$filename = $_FILES["file"]["tmp_name"];

if ($_FILES["file"]["size"] > 0){
    $file = fopen($filename, "r");

    while (!feof($file)){
        $getData = fgetcsv($file, '0');

        $sql = "SELECT * FROM murid WHERE No_Sek_Murid = '".$getData[0]."'";
        $result = mysqli_query($conn, $sql);

        if(empty($getData[0] || $getData[1] || $getData[2])){
            $errorForm = "Sila isikan semua medan dalam fail!";
            echo "<script type='text/javascript'>alert('$errorForm');</script>";
            echo "<script> location.href='../main.php'; </script>";
            exit();
        }

        if(mysqli_num_rows($result) === 0){
            $sqlMurid = "INSERT INTO murid (No_Sek_Murid, Nama_Murid, Kelas_Murid) VALUES ('".$getData[0]."', '".$getData[1]."', '".$getData[2]."')";
            $sqlKelab = "INSERT INTO kelab (Kod_Kelab, No_Sek_Murid, ID_Pengguna) VALUES ('{$_SESSION['kodKelab']}', '".$getData[0]."', '{$_SESSION['username']}')";
            mysqli_query($conn, $sqlMurid);
            mysqli_query($conn, $sqlKelab);

            $success = "Berjaya menambah rekod ke dalam pangkalan data!";
            echo "<script type='text/javascript'>alert('$success');</script>";
            echo "<script> location.href='../main.php'; </script>";
            exit();
        }

    } fclose($file);

} else {
    $errorfile = "Operasi import gagal!";
    echo "<script type='text/javascript'>alert('$errorfile');</script>";
    echo "<script> location.href='../main.php'; </script>";
    exit(); 
}

}

A:

Don't use exit() unnecessarily. Also you passed multiple parameters to empty() function which seems incorrect. You can run your code without exit function as below:
if (isset($_POST['submitI'])){
$filename = $_FILES["file"]["tmp_name"];

if ($_FILES["file"]["size"] > 0){
    $file = fopen($filename, "r");

    while (!feof($file)){
        $getData = fgetcsv($file, '0');

        $sql = "SELECT * FROM murid WHERE No_Sek_Murid = '".$getData[0]."'";
        $result = mysqli_query($conn, $sql);

        if(empty($getData[0]) || empty($getData[1]) || empty($getData[2])){
            $errorForm = "Sila isikan semua medan dalam fail!";
            echo "<script type='text/javascript'>alert('$errorForm');</script>";
            echo "<script> location.href='../main.php'; </script>";
        } elseif(mysqli_num_rows($result) === 0){
            $sqlMurid = "INSERT INTO murid (No_Sek_Murid, Nama_Murid, Kelas_Murid) VALUES ('".$getData[0]."', '".$getData[1]."', '".$getData[2]."')";
            $sqlKelab = "INSERT INTO kelab (Kod_Kelab, No_Sek_Murid, ID_Pengguna) VALUES ('{$_SESSION['kodKelab']}', '".$getData[0]."', '{$_SESSION['username']}')";
            mysqli_query($conn, $sqlMurid);
            mysqli_query($conn, $sqlKelab);

            $success = "Berjaya menambah rekod ke dalam pangkalan data!";
            echo "<script type='text/javascript'>alert('$success');</script>";
            echo "<script> location.href='../main.php'; </script>";
        }

    } fclose($file);

} else {
    $errorfile = "Operasi import gagal!";
    echo "<script type='text/javascript'>alert('$errorfile');</script>";
    echo "<script> location.href='../main.php'; </script>";
}

