File manager - Edit - /home/webapp69.cm.in.th/u69319090023/Shop23/api/install.php
Back
<?php /** * Database Auto Installer & Migrator * Run this once via browser: https://webapp69.cm.in.th/u69319090023/Shop23/api/install.php */ require_once __DIR__ . '/db.php'; try { $sqlFile = __DIR__ . '/schema.sql'; if (!file_exists($sqlFile)) { sendResponse(false, null, 'schema.sql not found', 404); } $sql = file_get_contents($sqlFile); $pdo->exec($sql); sendResponse(true, [ 'tables_created' => ['users', 'products', 'orders', 'addresses', 'coupons'], 'default_admin' => 'admin@cmtc.ac.th' ], 'ติดตั้งตารางและเตรียมระบบฐานข้อมูล MySQL เรียบร้อยแล้ว!'); } catch (Exception $e) { sendResponse(false, null, 'เกิดข้อผิดพลาดในการติดตั้งฐานข้อมูล: ' . $e->getMessage(), 500); }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings