-
Notifications
You must be signed in to change notification settings - Fork 0
/
database_table.php
41 lines (32 loc) · 904 Bytes
/
database_table.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
<?php
include "db_conn.php";
$query1 = "CREATE TABLE IF NOT EXISTS users (
user_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username varchar(50),
password varchar(50)
);";
$query1 = "CREATE TABLE IF NOT EXISTS gym_banner (
Gym_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Gym_name varchar(50)
);";
$query2 = "CREATE TABLE IF NOT EXISTS members (
member_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
full_name varchar(50),
mobile_number INT(20),
doj DATE,
active boolean NOT NULL default 1
);";
$query3 = "CREATE TABLE IF NOT EXISTS members_Fee (
transaction_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
member_id INT,
date DATE,
fees INT(50),
month INT(10),
year INT(4)
)";
if($conn->query($query1) && $conn->query($query2) && $conn->query($query3)){
echo "tables created successfully";
}else{
echo "ERRoR! ".$conn->error;
}
?>