public function ProcessBroacast() { $cron = new CronFunctions(); $db_ext = new DbExt(); $stmt = "SELECT * FROM\n\t\t{{sms_broadcast}}\n\t\tWHERE\n\t\tstatus IN ('pending')\n\t\tLIMIT 0,1\n\t\t"; if ($res = $db_ext->rst($stmt)) { foreach ($res as $val) { dump($val); if ($val['send_to'] == 1) { $cron->getAllCustomer($val); } elseif ($val['send_to'] == 2) { echo "Merchant customer"; $cron->getAllCustomerByMerchant($val); } else { echo "custom mobile"; $cron->customMobile($val); } $db_ext->updateData("{{sms_broadcast}}", array('status' => "process", 'date_modified' => date('c')), 'broadcast_id', $val['broadcast_id']); } } else { echo "<p>No records to process</p>"; } }