batch_insert.php: indentation looks better now. #9

Merged
mrlan merged 1 commits from Hui-IndentCode into master 2021-07-24 10:31:26 +08:00
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>";
} }
} }