Welcome Guest, Not a member yet? Register   Sign In
SQL execution timeout on single row
#1

(This post was last modified: 05-10-2022, 03:36 AM by sjender.)

Hi,
I have a simple query.
PHP Code:
$serviceData $this->db->query("SELECT * FROM `services` WHERE `id` = ?", [$serviceId]);

return 
$serviceData->getResultArray() ?? []; 

This gives output, but since it's only 1 row (can never be more), I would like to use getRowArray() instead...
But that throws a maximum exection timeout on SQL...
Even when I use return $serviceData->getResultArray()[0] this execution timeout is thrown.

The collected data consists of 10 columns with very little data in it, so it can't possible be a heavy query....
I've tried the query builder as wel, same results.

I'm a little confused on where I should look for a solution for this issue....

never mind.....
It was an error somewhere further in the script calculating these results...
Reply
#2

You could also add a 'LIMIT 1;' at the end of the query.
Reply
#3

Did you try your query in phpAdmin to see if it is working correctly?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB