Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:17:26+00:00 2026-06-15T15:17:26+00:00

When a user is in their account and clicks ‘delete account’ its supposed to

  • 0

When a user is in their account and clicks ‘delete account’ its supposed to delete the user, along with messages they left for users, and also stop showing as a friend to other users. I have 2 of these working but messages still appear for another user if they log in. I have a function already created that a user can use to delete messages from friends, and I’ve tried to implement this into a new function so it will delete messages, but from specific friends. Here is the original deleteMsg which will delete all the fields(message_id, from, to, message) so the message will be deleted in the messages database. This function appears in my messages model:

function deleteMsg($message_id)
 {

$this->db->where(array('message_id' => $message_id));
$this->db->delete('messages');

 }

Here is the function I’m trying to implement so that when the delete account is called it will delete all messages left by this now deleted user on other user’s homepages. It also appears in my model:

  function deleteAccountMsg($message_id, $from)
  {
$delAcctMsg = $this->db->select('*')->from('messages')->where('message_id', $message_id)->where('from', $from);
$delete = $this->db->delete('messages', $delAcctMsg);

    }

Finally, here is the DeleteUserAccount function in my controller that is supposed to grab everything associated with the user and delete it :

 function Deleteuseraccount()
 {
    parent::__construct();

    $this->load->model("membership");
    $this->load->model("friends");
    $this->load->model("messages");


    $username = $this->session->userdata('username');
    $this->membership->deleteUser($username);
    $this->friends->deleteMemberFriend($username, $friendname);
    $this->messages-> deleteAccountMsg($message_id, $from);// this is the function I'm calling that isn't deleting the associate messages from the deleted user
    $this->session->sess_destroy();
    redirect('start');
 } 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:17:27+00:00Added an answer on June 15, 2026 at 3:17 pm

    $this->db->select(‘*’)->from(‘messages’)->where(‘from’, $username)->or_where(‘to’, $username);

    This actually solved this issue

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once a user logs into their account, they are presented with a list of
I've created an account verification system where a user clicks a link in their
I have a user registration Form. If a new User register their account in
I have a a user that has a lot of tables against their account.
elseif(isset($_POST['submit'])) { // Look for their user $lookuser = mysql_query(SELECT * FROM `users` WHERE
I have a script that registers users based on their user input. This uses
We're setting up a feature to enable users to reset their password when they
I have an account page where the user can view their account information.. I
So I have some information I show a user about their account. However, an
I have a function that allows a user to deactivate their account. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.