Andreu | 8192d55 | 2019-09-22 16:51:39 +0200 | [diff] [blame] | 1 | <?php |
| 2 | require '../credentials.php'; |
| 3 | require '../php/utils.php'; |
| 4 | |
| 5 | $dbname = $_GET['dbname']; |
| 6 | |
| 7 | $create = "CREATE TABLE `".$dbname."` ( |
| 8 | `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, |
| 9 | `nom` varchar(100) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL, |
| 10 | `curs` tinyint(1) NOT NULL, |
| 11 | `grau` tinyint(1) NOT NULL, |
| 12 | `quimata` int(11) NOT NULL, |
| 13 | `requested` tinyint(1) NOT NULL DEFAULT 0, |
| 14 | `mort` tinyint(1) NOT NULL DEFAULT 0, |
| 15 | `password` varchar(100) NOT NULL DEFAULT '' |
| 16 | )"; |
| 17 | |
Andreu | 04f79ef | 2019-09-22 18:52:19 +0200 | [diff] [blame^] | 18 | /* |
| 19 | CREATE TABLE `morts` ( |
| 20 | `id` int(11) NOT NULL, |
| 21 | `quimatava` int(11) NOT NULL, |
| 22 | `assassi` int(11) NOT NULL, |
| 23 | `curs` tinyint(1) NOT NULL, |
| 24 | `grau` tinyint(1) NOT NULL, |
| 25 | `data` date NOT NULL DEFAULT current_timestamp() |
| 26 | ) |
| 27 | */ |
| 28 | |
Andreu | 8192d55 | 2019-09-22 16:51:39 +0200 | [diff] [blame] | 29 | if (query($create)) header("Location: ./index.php?dbname=".$dbname); |
| 30 | ?> |