Initial commit: 교육 프로젝트 배포
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../db_conn.php';
|
||||
|
||||
$pdo = db_conn();
|
||||
|
||||
echo "--- SHOW CREATE TABLE ---\n";
|
||||
$row = $pdo->query('SHOW CREATE TABLE edu_learning_histories')->fetch(PDO::FETCH_ASSOC);
|
||||
echo ($row['Create Table'] ?? 'N/A') . "\n\n";
|
||||
|
||||
echo "--- INDEXES ---\n";
|
||||
$stmt = $pdo->query('SHOW INDEX FROM edu_learning_histories');
|
||||
foreach ($stmt as $r) {
|
||||
echo ($r['Key_name'] ?? ''), "\t",
|
||||
($r['Seq_in_index'] ?? ''), "\t",
|
||||
($r['Column_name'] ?? ''), "\t",
|
||||
((int)($r['Non_unique'] ?? 1) === 0 ? 'UNIQUE' : 'NON_UNIQUE'),
|
||||
"\n";
|
||||
}
|
||||
Reference in New Issue
Block a user