batch_insert.php: indentation looks better now.

Hui-IndentCode
Lan Hui 2021-07-24 10:27:47 +08:00
parent 50049bf443
commit 5cc20395a0
1 changed files with 5 additions and 5 deletions

View File

@ -36,13 +36,13 @@ $user = explode(' ', $source2);
for($index=0; $index < count($user); $index++) { for($index=0; $index < count($user); $index++) {
$result = mysqli_query($conn, "SELECT * FROM `students_data` WHERE Student_ID='$user[$index]'"); $result = mysqli_query($conn, "SELECT * FROM `students_data` WHERE Student_ID='$user[$index]'");
if (mysqli_num_rows($result) < 1) { 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 . "<br>" . mysqli_error($conn); echo "SQL Error: " . $sql_stmt . "<br>" . mysqli_error($conn);
} else { } else {
echo "<p>Student number $user[$index] added.</p>"; echo "<p>Student number $user[$index] added.</p>";
} }
} else { } else {
echo "<p><b>Student number $user[$index] already exists.</b></p>"; echo "<p><b>Student number $user[$index] already exists.</b></p>";
} }
} }