This is a theoretical question. I know exactly what's going wrong, I just don't see a way around it.
I'm calling calling php page B from php page A in an ajax request and submitting a query in php page B. I'm trying to get the data back to php page A as a json_encoded array. The problem is that the json variable is overflowing (maxing out the memory_limit).
As a result I'm getting an exception:
[object Object] parsererror SyntaxError: JSON.parse: unexpected character
If I wasn't trying to get this data back as a json_encoded array for purposes of displaying it, I would just echo the data to the screen rather than store it in the variable. But, since I need to get that data back as a json_encoded array, I kind of have to store it.
The only solution I can think of is to simply echo the data out on php page B and change the way I'm handling the date on page A (i.e. not expecting json as the dataType).
Is there any other possible way (barring limiting the rows returned from the query)?
EDIT: I also don't want to change any of the settings in the php.ini. There has to be a clever solution without mucking around with settings.