-
Notifications
You must be signed in to change notification settings - Fork 1
/
bdinstal.php
executable file
·75 lines (67 loc) · 1.93 KB
/
bdinstal.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
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
<?php
//on fait la connexion � mysql
mysql_connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PWD);
mysql_select_db(MYSQL_DB);
$requete = "CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."utilisateur`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniqid` varchar(15) NOT NULL,
`pseudo` varchar(255) NOT NULL,
`nom` varchar(255) NOT NULL,
`prenom` varchar(255) NOT NULL,
`mot_de_passe` varchar(255) NOT NULL,
`mail` varchar(255) NOT NULL,
`date_inscription` datetime NOT NULL,
`date_anniversaire` date NOT NULL,
`signature` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
)";
mysql_query($requete);
$requete = "CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."album`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniqid` varchar(15) NOT NULL,
`id_utilisateur` int(11) NOT NULL,
`nom` varchar(255) NOT NULL,
`date_creation` datetime NOT NULL,
`date_mise_a_jour` datetime NOT NULL,
`privacy` varchar(255) DEFAULT NULL,
`is_temp` TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
)";
mysql_query($requete);
$requete = "CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."photo`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniqid` varchar(15) NOT NULL,
`id_album` int(11) NOT NULL,
`legend` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`date_upload` datetime NOT NULL,
`privacy` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
)";
mysql_query($requete);
/**
* v0.1.1 seen propeties
*/
$requete = "ALTER TABLE `".TABLE_PREFIX."photo`
ADD `seen` int(11) NOT NULL DEFAULT '0'";
$res = mysql_query($requete);
if( $res === false ) {
echo mysql_error( );
}
$requete = "ALTER TABLE `".TABLE_PREFIX."album`
ADD `seen` int(11) NOT NULL DEFAULT '0'";
$res = mysql_query($requete);
if( $res === false ) {
echo mysql_error( );
}
/**
* v0.1.2 order propety
*/
$requete = "ALTER TABLE `".TABLE_PREFIX."photo`
ADD `ordering` int(11) DEFAULT NULL";
$res = mysql_query($requete);
if( $res === false ) {
echo mysql_error( );
}
//on se d�connecte
mysql_close();