
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.73 KB | hits: 11 | expires: Never
Script timeouts while trying to add large amount of rows
public function generateQrCodes($program_id = null, $amount = 10000)
{
//add entries into database & generate QR images
for ($i = 1; $i++; $i <= $amount) {
$this->_createQr($program_id, $i);
}
//generate ZIP file
}
private function _createQr($program_id, $number)
{
//save into database
$this->create();
$this->data['Qrcode']['program_id'] = $program_id;
$this->data['Qrcode']['qr'] = $number;
$saved = $this->save();
if ($saved) {
$this->_createQrImage($program_id, $number);
return true;
} else {
return false;
}
}