From 5cc20395a049a989fc2571161f7c20a370388547 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Sat, 24 Jul 2021 10:27:47 +0800 Subject: [PATCH] batch_insert.php: indentation looks better now. --- batch_insert.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/batch_insert.php b/batch_insert.php index 00dad1b..20867af 100644 --- a/batch_insert.php +++ b/batch_insert.php @@ -36,13 +36,13 @@ $user = explode(' ', $source2); for($index=0; $index < count($user); $index++) { $result = mysqli_query($conn, "SELECT * FROM `students_data` WHERE Student_ID='$user[$index]'"); if (mysqli_num_rows($result) < 1) { - if (! mysqli_query($conn, "REPLACE INTO `students_data`(`Student_ID`, `Passport_Number`) VALUES('$user[$index]', '')" ) ) { + if (! mysqli_query($conn, "REPLACE INTO `students_data`(`Student_ID`, `Passport_Number`) VALUES('$user[$index]', '')" ) ) { echo "SQL Error: " . $sql_stmt . "
" . mysqli_error($conn); - } else { - echo "

Student number $user[$index] added.

"; - } + } else { + echo "

Student number $user[$index] added.

"; + } } else { - echo "

Student number $user[$index] already exists.

"; + echo "

Student number $user[$index] already exists.

"; } } -- 2.17.1