mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-04-22 10:52:09 +00:00
change db user/pass
This commit is contained in:
parent
15ec447587
commit
c3de69cddc
@ -12,7 +12,7 @@ CREATE TABLE posts (
|
|||||||
url VARCHAR(32),
|
url VARCHAR(32),
|
||||||
content TEXT,
|
content TEXT,
|
||||||
short varchar(256),
|
short varchar(256),
|
||||||
dt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
categorie INT,
|
categorie INT,
|
||||||
author INT
|
author INT
|
||||||
);
|
);
|
||||||
@ -83,8 +83,8 @@ FROM post
|
|||||||
INNER JOIN users BY post.author=user.id
|
INNER JOIN users BY post.author=user.id
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
-- requette 3 : comme la 1 sauf uniquement les 6 posts les plus récents
|
-- requette 3 : comme la 1 sauf uniquement les 6 posts les plus r<EFBFBD>cents
|
||||||
-- requete lancée lors sur la page d'accueil
|
-- requete lanc<EFBFBD>e lors sur la page d'accueil
|
||||||
SELECT title, categories.name as categorie, dt as date, short as content
|
SELECT title, categories.name as categorie, dt as date, short as content
|
||||||
FROM posts
|
FROM posts
|
||||||
INNER JOIN categories ON categories.id=posts.categorie
|
INNER JOIN categories ON categories.id=posts.categorie
|
||||||
|
@ -13,8 +13,8 @@ function endsWith($haystack, $needle) {
|
|||||||
function connect() {
|
function connect() {
|
||||||
$host = "localhost";
|
$host = "localhost";
|
||||||
$db = "blog";
|
$db = "blog";
|
||||||
$user = "root";
|
$user = "blog";
|
||||||
$pass = "root";
|
$pass = "blog";
|
||||||
$charset="utf8mb4";
|
$charset="utf8mb4";
|
||||||
|
|
||||||
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
|
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user