Welcome Guest, Not a member yet? Register   Sign In
Is it ok to delete like this $this->db->delete('freebook', array('day <' => $yesterday));
#2

[eluser]RobertSF[/eluser]
No, deleting rows one at a time from an SQL database is much more inefficient than deleting them all at once. What you have there seems fine, except that wouldn't your query as you have it delete all entries with dates before yesterday?

Frankly, SQL itself is hard enough that I prefer to work out the SQL, and then just do a $this->db->query('whatever I'm doing in SQL'). As far as I can tell, the CI database method query will execute any SQL statement. 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, 03:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB