-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdbconnect.php
executable file
·44 lines (35 loc) · 1.13 KB
/
dbconnect.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// // Get the required codes from the configuration file
$server = "mudfoot.doc.stu.mmu.ac.uk";
$username = "tanveeah";
$password = "wErthlep4";
$database ="tanveeah";
$con = new mysqli($server,$username,$password,$database);
if (!$con){
die('Could not connect: ' . mysqli_connect_error($con));
}
/*
CREATE TABLE IF NOT EXISTS `transactions` (
`TID` int(11) NOT NULL AUTO_INCREMENT,
`item_name` varchar(255) NOT NULL,
`payer_email` varchar(150) NOT NULL,
`first_name` varchar(150) NOT NULL,
`last_name` varchar(150) NOT NULL,
`amount` float NOT NULL,
`currency` varchar(50) NOT NULL,
`country` varchar(50) NOT NULL,
`txn_id` varchar(100) NOT NULL,
`txn_type` varchar(100) NOT NULL,
`payment_status` varchar(100) NOT NULL,
`payment_metod` varchar(100) NOT NULL,
`create_date` datetime NOT NULL,
`payment_date` datetime NOT NULL,
PRIMARY KEY (`TID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
**/
// if (mysqli_query($con,$tbl)) {
// echo "Table persons created successfully";
// } else {
// echo "Error creating table: " . mysqli_error($con);
// }
?>