[eluser]Unknown[/eluser]
I receive a lot of said error since early this year.
Example:
Code:
....
$query = $this->db->query($sql);
$result = $query->result_array(); <-- error here!
....
From php error log, I found the above code being requested multiple times per second, which I believe causing delay on Mysql to produce the
object. I tried to simulate multiple request/second on my localhost but no such error exist. However, it does happen to my shared-hosting server (few sites, diff servers).
Hence, can someone advice wither below code should work?
Example:
Code:
....
$query = $this->db->query($sql);
while (!is_object($query)) //Wait until $query become an object
sleep(1);
$result = $query->result_array();
....
Can I wait
$query become an
object first, BEFORE continue with the the next line?
Thanks a lot.