• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Delete not working properly as wanted

#3
(02-09-2017, 11:43 PM)Wouter60 Wrote: Did you try
PHP Code:
$this->db->where('code >',''); 

This has worked now using a foreach loop


PHP Code:
public function clear_unconfirmed_post() {
        $this->db->select('*');
        $this->db->from($this->db->dbprefix 'post');
        $query $this->db->get();
        foreach ($query->result_array() as $result) {
            if (!empty($result['code'])) {
                $this->db->where('code'$result['code']);
                 $this->db->where('date_created < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 15 MINUTE))'NULLFALSE);
                $this->db->delete($this->db->dbprefix 'post');
            }
        }
 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Delete not working properly as wanted - by wolfgang1983 - 02-10-2017, 03:19 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.