Please give me little help, I found in google and stackoverFlow but cant find solution.
In my website has 80,000 rows, and daily 1000 rows increase,
My web all Queries work properly, but some time pagination query return error, (after 30-60 sec)
Warning: PDOStatement::execute(): MySQL server has gone away in
/home/name/public_html/example.com/classes/functions.php on line 226
Warning: PDOStatement::execute(): Error reading result set's header in
/home/name/public_html/example.com/classes/functions.php on line 226
I am using simple count Query, I use pagination with different condition, and if return rows is more than 8000, only that query ERROR show but some time,,
Here is a simple one query Example
$query = "SELECT COUNT(DISTINCT(groupName)) FROM `table` WHERE `type` = 'string'";
//return expect 24,000 count
Now please Any Expert give me solution.
I test one thing to check server response,
I test , and get table 20,000 rows with WHERE CLAUSE
and server return 20,000 rows from same table where pagination query run, but What the problem with my pagination Query? Why its return SERVER GONE AWAY Error
Please Dont suggest me to Increase server time out limit, I want to load my website with in 2 sec, not with in 2 min.
Table structure