I have the following quite simple test PHP code that extracts the data and puts it into JSON formatted text.
I get the following error..
Fatal err
You are probably encoding a very large dataset. You could encode each row, one row at a time instead of encoding it in one big operation.
That way, each call to json_encode()
only encodes a small array instead of a large one. The end result is the same. This is IMO the solution which will use the less memory.