Answer the question
In order to leave comments, you need to log in
How to display random articles correctly?
Hello.
I want to display other random articles on the article page, I did it as follows:
$randomId = [];
$res = $dbh->query("SELECT * FROM goods WHERE id");
foreach ($res as $key) {
$randomId[] = $key["id"];
}
Answer the question
In order to leave comments, you need to log in
1 request!
2. Option 2 (faster with a large number of entries): https://stackoverflow.com/a/4329447
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question