Fehlermeldung
Ich merke ich habe einen Fehler in meiner install.php gemacht, aber ich finde ihn nicht:
Code:
<?php
$connect = mysql_connect("host","user","pass") or die (mysql_error());
mysql_select_db("datenbank", $connect) or die (mysql_error());
$result_1 = mysql_query("
CREATE TABLE `foren` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` tinytext NOT NULL,
PRIMARY KEY (`id`)
)
") or die (mysql_error());
$result_2 = mysql_query("
CREATE TABLE `threads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fid` int(11) DEFAULT 0,
`topic` tinytext NOT NULL,
`created` timestamp,
PRIMARY KEY (`id`)
)
") or die (mysql_error());
$result_3 = mysql_query("
CREATE TABLE `answers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tid` int(11) DEFAULT 0,
`fid` int(11) DEFAULT 0,
`user` tinytext NOT NULL,
`topic` tinytext NOT NULL,
`text` text NOT NULL
`created` timestamp,
PRIMARY KEY (`id`)
)
") or die (mysql_error());
if($result_1) {
echo "Tabelle Foren wurde angelegt.<br>";
}
if($result_2) {
echo "Tabelle Threads wurde angelegt.<br>";
}
if($result_3) {
echo "Tabelle Answers wurde angelegt.<br>"
}
?>
Die drei Tabellen die erstellt werden sollen:
Tabelle 1:
+-------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| name | tinytext | | | | |
+-------+----------+------+-----+---------+----------------+
Tabelle2:
+---------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| fid | int(11) | | | 0 | |
| topic | tinytext | | | | |
| created | timestamp(14) | | | | |
+---------+---------------+------+-----+---------+----------------+
Tabelle3:
+---------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| tid | int(11) | | | 0 | |
| fid | int(11) | | | 0 | |
| user | tinytext | | | | |
| topic | tinytext | | | | |
| text | text | | | | |
| created | timestamp(14) | | | | |
+---------+---------------+------+-----+---------+----------------+