prepare($sql); $stmt->execute([$name, $email, $phone, $address]); } catch (PDOException $e) { die("Could not connect to the database $dbname :" . $e->getMessage()); } } // Create table if not exists try { $pdo = db(); $sql = "CREATE TABLE IF NOT EXISTS customers ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, address TEXT NOT NULL, status VARCHAR(255) DEFAULT 'active', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )"; $pdo->exec($sql); } catch (PDOException $e) { die("Could not connect to the database $dbname :" . $e->getMessage()); } // Fetch customers try { $pdo = db(); $stmt = $pdo->query("SELECT * FROM customers ORDER BY created_at DESC"); $customers = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { die("Could not connect to the database $dbname :" . $e->getMessage()); } ?> Customer Management

Customer Management

Add New Customer
Customer List
ID Name Email Phone Address Status Created At
No customers found.