-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_db_update.php
More file actions
24 lines (19 loc) · 930 Bytes
/
run_db_update.php
File metadata and controls
24 lines (19 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
include('config.php');
echo "<h1>Adding Missing Column to mock_atmpt_list Table</h1>";
// Check if the integrity_category column exists
$category_check = "SHOW COLUMNS FROM mock_atmpt_list LIKE 'integrity_category'";
$category_exists = mysqli_query($conn, $category_check);
if (mysqli_num_rows($category_exists) == 0) {
// Add the integrity_category column
$add_category = "ALTER TABLE mock_atmpt_list ADD COLUMN integrity_category VARCHAR(50) DEFAULT 'Good'";
if (mysqli_query($conn, $add_category)) {
echo "<p>Added integrity_category column to mock_atmpt_list table.</p>";
} else {
echo "<p>Error adding integrity_category column: " . mysqli_error($conn) . "</p>";
}
} else {
echo "<p>integrity_category column already exists in mock_atmpt_list table.</p>";
}
echo "<p>Database update completed.</p>";
echo "<p><a href='students/mock_exams.php'>Return to Mock Exams</a></p>";