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

  • Home
  • SEARCH
  • 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 6893451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:39:37+00:00 2026-05-27T06:39:37+00:00

I use CodeIgniter 2.1.0, i want after insert data in database get a message

  • 0

I use CodeIgniter 2.1.0, i want after insert data in database get a message like “Your information was successfully updated.”. For this work i have in CI_Controller following function:

function myCiInser(){
... Here is my query ...
//$data: this var is result query that is true
if($data){
    $this -> session -> set_flashdata('message', 'Your information was successfully updated.');
    redirect('url/myurl');
            }
}

And i have in view as:

<?php
$message = $this->session->flashdata('message');
    if($message){
        echo '<div id="error_text">' . $message . '</div>';
    }
//I test this : "echo $message;" but don't give output
?>

But i don’t give message in view but redirect is done and work true. and in database in table ci_sessions column user_data i have this:

a:2:{s:9:”user_data”;s:0:””;s:19:”flash:new:message”;s:42:”Your
information was successfully updated.”;}

How can fix this problem?

UPDATE:

I had the following error (i use from chorme and by Ctrl+Shift+j i get this alert):

Failed to load resource: the server responded with a status of 404
(Not Found)

And i fix it (Now i do not have the error) but still is same problem in display message. what do i do?

  • 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-05-27T06:39:38+00:00Added an answer on May 27, 2026 at 6:39 am

    From the Codeigniter Session Class documentation, regarding Flashdata we can read:

    CodeIgniter supports “flashdata”, or session data that will only be
    available for the next server request, and are then automatically
    cleared.

    Your problem might be that when you redirect, the process takes more than one request, clearing your flashdata.

    To see if that’s the case, just add the following code to the constructor of the controller you are redirecting to:

    $this->session->keep_flashdata('message');
    

    This will keep the flashdata for another server request, allowing it to be used afterwards.

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

Sidebar

Related Questions

I use CodeIgniter 2.1.0, i store data session in database ci_sessions , i want
i use a simple PHP framework (like Codeigniter) without ORM. I have a database
I want to insert current time in database using mySQL function NOW() in Codeigniter's
I use codeigniter. I want multiple upload image, for this work, i use library
I use codeigniter, i want make valid data for captcha, if captcha is mixed
I'm running a LAMP environment with CodeIgniter. I want to be able to use
Is there a way to integrate CodeIgniter with phpBB3? I would like to use
I use codeigniter.I want search in site contents for several word, that did existence
I just started using OOP / CodeIgniter. I want to get assign the form
Just starting to use CodeIgniter, and I'd like to import some of my old

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.