It's always a good idea to be able to delete users from an interface rather than removing them from the database directly or not deleting them at all. We're going to create a CRUD interface to allow us to remove users from the database. Here's how to do it.
We'll need to create one file:
path/to/codeigniter/application/views/users/delete_user.php
Add the following code into the,
views/users/delete_user.php
file:<?php echo form_open('users/delete_user'); ?> <?php if (validation_errors()) : ?> <h3>Whoops! There was an error:</h3> <p><?php echo validation_errors(); ?></p> <?php endif; ?> <?php foreach ($query->result() as $row) : ?> <?php echo $row->first_name . ' ' . $row->last_name; ?> <?php echo form_submit('submit', 'Delete'); ?> or <?php echo anchor('users/index', 'cancel'); ?> <?php echo form_hidden('id', $row->id...