mirror of
https://github.com/p08dev/Bloggr.git
synced 2026-06-17 12:43:56 +02:00
Fixed setup error
Fixed db structure
This commit is contained in:
@ -22,8 +22,8 @@ if(@include(__DIR__."/config.php")) {
|
|||||||
if(!($request_uri == "/setup")) {
|
if(!($request_uri == "/setup")) {
|
||||||
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
|
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
|
||||||
$auth = new \Bloggr\Auth($pdo);
|
$auth = new \Bloggr\Auth($pdo);
|
||||||
}
|
|
||||||
|
|
||||||
if ($auth->isLoggedIn()) {
|
if ($auth->isLoggedIn()) {
|
||||||
echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
|
echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -17,10 +17,11 @@ CREATE TABLE IF NOT EXISTS `users` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `posts` (
|
CREATE TABLE `posts` (
|
||||||
`id` int(11) UNSIGNED NOT NULL,
|
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`user` int(11) UNSIGNED NOT NULL,
|
`user` int(11) UNSIGNED NOT NULL,
|
||||||
`title` varchar(128) CHARACTER SET utf8mb4 NOT NULL,
|
`title` varchar(128) CHARACTER SET utf8mb4 NOT NULL,
|
||||||
`text` longtext CHARACTER SET utf8mb4 NOT NULL,
|
`text` longtext CHARACTER SET utf8mb4 NOT NULL,
|
||||||
`created_at` int(10) UNSIGNED NOT NULL,
|
`created_at` int(10) UNSIGNED NOT NULL,
|
||||||
`updated_at` int(10) UNSIGNED DEFAULT NULL
|
`updated_at` int(10) UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|||||||
Reference in New Issue
Block a user