How to send Email From your Web server with the PHPMailer (SMTP)
How to send Email From your Web server with the PHPMailer (SMTP)
Suggested:
How to Delete Data in Database using Codeigniter
In this tutorial, we have handled Codeigniter delete Data using mysql,jQuery.
We have handled tutorial in very easy steps. So let’s start the coding
Here put some sample code. for full source code click download now end of post
In datatable list view click on delete button
on click call delete function
Delete function in application/controllers/user.php
sample code
function delete($userId)
{
$this->isLoggedIn();
$this->load->model('User_model');
$user = $this->User_model->getUser($userId);
if ($user && !empty($user['img'])) {
$imagePath = './uploads/' . $user['img'];
if (file_exists($imagePath)) {
unlink($imagePath);
}
}
$this->User_model->deleteUser($userId);
}
In user model deleteUser function call
sample code
function deleteUser($userId)
{
$this->db->where('id', $userId);
$this->db->delete('codeignitercrud');
}
Download Full Code HERE
How to send Email From your Web server with the PHPMailer (SMTP)
How to send Email From your Web server with the PHP mail() function
User Registration and Login using CodeIgniter