-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.php
46 lines (34 loc) · 1.12 KB
/
database.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
45
46
<?php
require_once 'config.php';
$sql = 'create database dox';
$sql1 = 'use dox';
$sql2 = 'CREATE TABLE login( '.
'name CHAR(20) NOT NULL, '.
'email VARCHAR(20) NOT NULL, '.
'password VARCHAR(20) NOT NULL)';
$sql3 = 'CREATE TABLE user( '.
'file CHAR(20) NOT NULL, '.
'type VARCHAR(20) NOT NULL, '.
'size VARCHAR(20) NOT NULL, '.
'photo VARCHAR(2000) NOT NULL, '.
'subject VARCHAR(2000) NOT NULL, '.
'branch VARCHAR(2000) NOT NULL, '.
'tmp_name VARCHAR(20) NOT NULL)';
$sql4 = 'CREATE TABLE registration( '.
'name CHAR(20) NOT NULL, '.
'email VARCHAR(20) NOT NULL, '.
'password VARCHAR(20) NOT NULL)';
//$ret = mysql_query( $sql, $conn );
$ret = mysql_query($sql, $conn);
$ret1 = mysql_query($sql1, $conn);
$ret2 = mysql_query($sql3, $conn );
echo "<br>";
if(! $ret2 ) {
die('Could not create database: <br>' . mysql_error());
}
else if(! $ret1 ) {
die('Could not create database: <br>' . mysql_error());
}
echo "Database created successfully\n";
mysql_close($conn);
?>