Skip to content

Commit b482746

Browse files
Update the sql querys
1 parent 1b09d11 commit b482746

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

class/Database/Mysql.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
class Mysql
1212
{
1313
private const DB_HOST = "localhost";
14-
private const DB_NAME = "blog";
15-
private const DB_USER = "mohammad";
16-
private const DB_PASS = "09351515982Mr@";
14+
private const DB_NAME = "php_blog";
15+
private const DB_USER = "root";
16+
private const DB_PASS = "";
1717

1818
private $db;
1919
private $stmt;
@@ -68,7 +68,7 @@ public function execute(): bool
6868
* Fetch the data as object from statement
6969
* @return object
7070
*/
71-
public function fetch(): object
71+
public function fetch()
7272
{
7373
return $this->stmt->fetch(PDO::FETCH_OBJ);
7474
}

db.sql

+3
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ CREATE TABLE IF NOT EXISTS `posts`
2424
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
2525
`published` ENUM ('Y', 'N') NOT NULL DEFAULT 'N'
2626
);
27+
28+
INSERT INTO `settings`(`blogTitle`, `blogDescription`, `blogAuthor`, `blogAuthorInfo`) VALUES ('Blog', 'Simple Blog', 'Jonh', 'Pro developer');
29+
INSERT INTO `users`(`username`, `password`, `email`, `is_admin`) VALUES ('admin', '$2y$10$sJp2evNq5fp8SkJu7CfGQOmY7pIMHFLd09eORbCVabkHlinn6RoOm', '[email protected]', 'Y');
2730
commit;

0 commit comments

Comments
 (0)