• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it ok to delete like this $this->db->delete('freebook', array('day <' => $yesterday));

#1
[eluser]gojo[/eluser]
Is it ok to use delete like this
Code:
$yesterday = date("Y-m-d");
$query = $this->db->get_where('freebook', array('day <' => $yesterday));
        if ($query->num_rows() != 0) {
        // delete all entries where it has yesterdays date
  
  $this->db->delete('freebook', array('day <' => $yesterday));

  
        }
or should I get them in a foreach and delete one at a time
Thanks in advance Gary Smile


Messages In This Thread
Is it ok to delete like this $this->db->delete('freebook', array('day <' => $yesterday)); - by El Forum - 10-27-2014, 12:39 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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