Files
edu/bbs/check_err.php
T

29 lines
788 B
PHP

<?php
require_once __DIR__ . '/db_conn.php';
try {
$pdo = db_conn();
echo "DB Connected.\n";
// Check procedure
$stmt = $pdo->query("SHOW PROCEDURE STATUS WHERE Db = 'baronhomep' AND Name = 'sp_insert_edu_access_log'");
$proc = $stmt->fetchAll();
if (empty($proc)) {
echo "Procedure sp_insert_edu_access_log DOES NOT EXIST.\n";
} else {
echo "Procedure sp_insert_edu_access_log exists.\n";
}
// check if u.belong_comp exists
$stmt = $pdo->query("SHOW COLUMNS FROM edu_users LIKE 'belong_comp'");
$col = $stmt->fetchAll();
if (empty($col)) {
echo "Column belong_comp DOES NOT EXIST in edu_users.\n";
} else {
echo "Column belong_comp exists.\n";
}
} catch (Exception $e) {
echo "Basic Error: " . $e->getMessage() . "\n";
}