How can I delete all lines from a table with codeigniter. Just a line I know, just specify the id from this line, but what about all lines at once? Thanks
In CodeIgniter, delete() method is used to delete an existing record from database table. $table(mixed):- The table(s) to delete from. Delete Record using $this->db->delete() This is how you can delete a record from ’employee_master’ table using $this->db->delete().
The Codeigniter Delete function is used to delete the one or more row data from database table. The truncate () method of codeigniter is used to remove all records from a database table. It performs the same function as a DELETE statement without a WHERE clause. My name is Devendra Dode.
Initially, all the records from the users table are listed in an HTML table. The user can select single or multiple rows in the table and delete multiple records from the MySQL database in CodeIgniter application. All the user’s data are retrieved from the database. Multiple rows can be selected using checkbox provided on each table row.
By clicking the checkbox in the table header, all checkboxes will be checked or unchecked. Once the delete button is clicked, a dialog will appear for the confirmation. After the confirmation, the form is submitted to delete selected records from the database. <!--
$this->db->empty_table('my_table');
Put it in your model and don't give any where before that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With