Question

Possible Duplicate:
How can i get more then 50 results to display in excel using mysql?

I have a problem: I have a MySQL script getting results and allowing customers to see their results through an Excel export. However, the spreadsheet is getting limited to only 50 results when the website shows lots more, sometimes up to 1500.

I've searched and it seems I have to edit /etc/my.cnf. I try to edit it and paste more code in but when I exit out of insert mode half of the code gets cut off - am I missing something?

This is all that is in my current /etc/my.cnf -- I realize its the default. I'm new to editing in vi so please bear with me.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Was it helpful?

Solution

This is likely not due to anything in my.cnf. Your query skeleton from the comments does LIMIT 0,50, so getting 50 rows back is the exact behavior you should expect. Remove the LIMIT 0, 50 clause from your query to get it to return all rows.

Update after comments:

Upon removing the LIMIT clause, the OP reported the script was timing out. The solution to this in PHP is to increase the max_execution_time via:

set_time_limit(300);
// OR
ini_set('max_execution_time', 300);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top