-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
79 lines (64 loc) · 1.94 KB
/
config.php
File metadata and controls
79 lines (64 loc) · 1.94 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
$host="182.50.133.55";
$user="auxstudDB7c";
$pass="auxstud7cDB1!";
$db= "auxstudDB7c";
$conn=mysqli_connect($host,$user,$pass,$db);
if(!$conn){
die("Connection failed: " . mysqli_connect_error());
}
$sql="CREATE TABLE IF NOT EXISTS user_tb_users_254 (
id INT(60) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
addresss VARCHAR(50),
email VARCHAR(50),
phone VARCHAR(50),
gender VARCHAR(50),
pass VARCHAR(50),
UNIQUE (email) )";
$query=mysqli_query($conn,$sql);
if(!$query)
{
echo "Error creating table: " . mysqli_error($conn)."<br>";
}
$sql="CREATE TABLE IF NOT EXISTS user_tb_movie_254 (
id INT(60) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30) NOT NULL,
category VARCHAR(50),
theme VARCHAR(50),
sound VARCHAR(50)
)";
$query=mysqli_query($conn,$sql);
if(!$query)
{
echo "Error creating table: " . mysqli_error($conn)."<br>";
}
$sql="CREATE TABLE IF NOT EXISTS user_tb_movie_img_254 (
id INT(60) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
img_path VARCHAR(30) NOT NULL,
movie_id INT(60) UNSIGNED NOT NULL,
FOREIGN KEY (movie_id) REFERENCES user_tb_movie_254(id)
ON DELETE CASCADE ON UPDATE CASCADE
)";
$query=mysqli_query($conn,$sql);
if(!$query)
{
echo "Error creating table: " . mysqli_error($conn)."<br>";
}
$sql="CREATE TABLE IF NOT EXISTS user_tb_user_movie_254 (
user_id INT(60) UNSIGNED NOT NULL,
movie_id INT(60) UNSIGNED NOT NULL,
PRIMARY KEY (user_id, movie_id),
CONSTRAINT Constr_movie_user_id_fk
FOREIGN KEY (user_id) REFERENCES user_tb_users_254 (id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT Constr_movie_user_m_id_fk
FOREIGN KEY (movie_id) REFERENCES user_tb_movie_254(id)
ON DELETE CASCADE ON UPDATE CASCADE
)";
$query=mysqli_query($conn,$sql);
if(!$query)
{
echo "Error creating table: " . mysqli_error($conn)."<br>";
}