Skip to content

Commit d3dc852

Browse files
committed
changes on last commit 6e6e2f8
1 parent 6e6e2f8 commit d3dc852

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

php/images-unsplash.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

php/setup-tables.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@
4545
mysqli_query($conn, $sql);
4646

4747
// Fill table news with dummy content
48-
require 'images-unsplash.php';
49-
50-
for ($i = 0; $i < 5; $i++) {
48+
$number_news = 5;
49+
for ($i = 0; $i < $number_news; $i++) {
5150
require 'fakename-generator.php';
5251

5352
$title = file_get_contents('https://loripsum.net/api/1/short/headers', FALSE, NULL, 4, mt_rand(15, 30));
54-
$img = $images_unsplash[mt_rand(0, sizeof($images_unsplash) - 1)];
53+
$img = 'https://picsum.photos/500/300?random='.$i;
5554
$body = file_get_contents('https://loripsum.net/api/1/short/headers', FALSE, NULL, 4, mt_rand(100, 250));
5655
$author = $random_fullname;
5756
$sql = "INSERT INTO news (title, img, body, author) VALUES ('".$title."', '".$img."', '".$body."', '".$author."');";

0 commit comments

Comments
 (0)