I'm trying to display all the records from a database but it's just spamming around 1,000 until it finally reaches 30 second timeout. I've only got 3 records in the database, not sure why it's doing this?
while($news = $engine->fetch_array("SELECT * FROM `cms_news` ORDER BY `id` DESC"))
{
echo 'lol<br>';
}
"lol" gets printed hundreds of times before finally timing out (execution time exceeded)
Here is the fetch_array function from the $engine class:
final public function fetch_array($sql)
{
$result = $this->connection->query($sql);
return $result->fetch_array(MYSQLI_ASSOC);
}