1 Mln of records... how show them?

  • Hi guys, I have a problem driving me crazy. I have to show (JSON) 1 mln of records using web services. Server procedure is:

    function getCiaos()
            $mysqli = new mysqli("localhost", "yyy", "xxx", "master");
            $uresult = $mysqli->query("SELECT id, data FROM ciao", MYSQLI_USE_RESULT);
            $arr = array();
            if($uresult) {
                    while($row = $uresult->fetch_array(MYSQLI_ASSOC)) {
                            $arr[$row['id']] = $row;
            return $arr;

    Client side is:

    $client=new SoapClient('http://www.example.com/webservice/nu2.php?wsdl', array('trace' => 1));
            $res = $client->getCiaos();

    Always php client show Internal error and Apache log show me:
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted

    Do you know a way to show these large datas without increase php_ini setting?

    Thank a lot!