December 2013
Intermediate to advanced
306 pages
6h 26m
English
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.phpviews/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'); ...Read now
Unlock full access