Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database not responding after a limit

Tags:

database

mysql

I have an problem in fetching records from database with php.

I have 31700 records in database. when i fetches records from this query:

select * from product_likes

Then, script was aborted and blank page was showing.but when i use limit in query (i.e. "select * from product_likes limit 0, 12000;") then it is giving upto 12000 records.

And when i fecthes records from this query:

select product_name, like_count from product_likes

Then, script was aborted and blank page was showing.but when i use limit in query (i.e. "select product_name, like_count from product_likes limit 0, 30000;") then it is giving upto 30000 records.

I can't understand where is the problem. And still i can't fetch all records.

Please let me know the reason, How can i overcome this problem...

like image 599
Chirayu Avatar asked May 23 '26 12:05

Chirayu


1 Answers

You may need to modify some server variables like PHP's memory_limit and MySQL's max_allowed_packet. But I wouldn't show that many items in a single page. Your server will not respond after more than a few visitors start to visit your web page.

like image 163
Halil Özgür Avatar answered May 26 '26 03:05

Halil Özgür



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!