PHP
php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
####### ORM with PDO This an example. In real implementation we will have used different files ##########
### NB : tHE CODE CANNOT RUN DUE TO ABSENCE OF DATABASE
# script to create the table ######
/* CREATE TABLE customers
(
id int(10) ,
name varchar(25),
age int(10),
phone varchar(20)
)*/
// interface for connection
interface IConnectInfo
{
const HOST ="localhost";
const UNAME ="root";
const PW ="";
const DBNAME = "blog";
public function doConnect();
}
// real implement of IconnectInfo
class UniversalConnect implements IConnectInfo
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run