Welcome Guest, Not a member yet? Register   Sign In
db->insert error
#2

(01-19-2017, 04:03 AM)DEVULDER Wrote:
PHP Code:
        for($i 0$i 1000000;$i++){
            
$uid uniqid('rsv'true);

            
$this->db->set('uid',$uid);
            
$this->db->set('data','toto' $i);
            
$this->db->reset_query();
            if ( 
$this->db->insert('ddr') == false ){

                break;
            }
            
$this->db->reset_query();
        } 

Error message Fatal error: Allowed memory size of 134217728 bytes exhausted  in /system/database/DB_driver.php on line 703

Um, 

well, first, you're resetting your query before you try to insert...

second... 1 million inserts is too much for your server's memory to handle at once with a for loop.

Did you have a question about it though?
Reply


Messages In This Thread
db->insert error - by DEVULDER - 01-19-2017, 04:03 AM
RE: db->insert error - by enlivenapp - 01-19-2017, 10:20 AM
RE: db->insert error - by DEVULDER - 02-02-2017, 02:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB