Quantcast
Channel: User JohnP - Stack Overflow
Viewing all articles
Browse latest Browse all 37

Answer by JohnP for How to Truncate Table using CakePHP?

$
0
0

NOTE: This answer is valid only up to CakePHP 1.3. I haven't used this on the never versions so I've no idea whether it works.

deleteAll only deletes the data, it does not truncate the table.

You'll need to call the query() method.

$this->Model->query('TRUNCATE TABLE table_name_in_mysql;')

http://book.cakephp.org/view/1027/query


Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>