This site uses cookies from Google to deliver its services, to personalize ads and to analyze traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. Learn More

How to empty or truncate mysql table using codeigniter active record? - mysql

tutsdot.blogspot.com - If you want to empty or truncate a mysql table using Codeigniter active record, use the following code.
To empty

 $this->db->empty_table(); 
This will generate a delete SQL string and runs the query.
 // DELETE FROM mytable 
To truncate
 $this->db->from('mytable'); $this->db->truncate(); // or $this->db->truncate('mytable'); 
This will generate a truncate SQL string and runs the query.
 // TRUNCATE mytable 
Source: http://www.learnhow2do.com/computer/internet/2013/04/13/learn-how-to-empty-or-truncate-table-using-codeigniter-active-record/

other source : http://merdeka.com, http://stackoverflow.com, http://developer-paradize.blogspot.com

0 Response to "How to empty or truncate mysql table using codeigniter active record? - mysql"

Post a Comment

Contact

Name

Email *

Message *