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 9180261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:00:11+00:00 2026-06-17T18:00:11+00:00

I am trying to submit a EDIT form which edits Users Academics Details, These

  • 0

I am trying to submit a EDIT form which edits Users Academics Details,
These Details have unique id in DB and my Code in Short Looks like below :

class edit extends ci_controller
{

function user_academics($id = NULL)
    {
        if(isset($id) == FALSE)     //if link is ./edit/user_academics
        {
            $id = NULL;
            $link = site_url('profile');
            show_error("Invalid Page Request! <a href='$link' Go to Profile </a>");
        }

        $user_id = $this->session->userdata('user_id');        
        $data['fill'] = $this->edit_model->get_user_academics($id);

        if($user_id != $data['fill']['user_id'])    // check if logged in user is accessing his record or others
        {
             $link = site_url('profile');
            show_error("This is an Invalid Request ! <a href='$link'>Go to Profile </a>");
        }
        else // actual work starts here
        {
            $this->session->set_flashdata('ua_id',$id); // update_academics will get this data

            $this->load->view('edit/edit_3_view',$data);

        }
    }

 function update_academics()
    {
        $ua_id =  $this->session->flashdata('ua_id');   // flash data used here .
        if( !$ua_id )
        {
            show_error('Sorry, This request is not valid!');

        }
      $academics = array( 
            // All post values
        );

        $this->edit_model->update_user_academics($academics,$ua_id);
        //print_r($academics);
        redirect('profile');

    }

}

Now the problem is
– If I open two different records to edit, then It will set only one Session Flash value.
– And No matter what I edit , the existing values of the last flash value gets updated.
Please Suggest me another way or Correct me if I am wrong in above code . Thanks

  • 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-17T18:00:13+00:00Added an answer on June 17, 2026 at 6:00 pm

    save that flashdata in array, like:

    $myArr = array('value 1', 'value 1');
    //set it
    $this->session->set_flashdata('some_name', $myArr);
    

    And in view:

    $dataArrs = $this->session->flashdata('some_name');
    //loop thru $dataArrs to show the flashdata
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form I'm trying to set up ... Users can have many
I am trying to have an Ajax form submit when the value within a
I have a form which sends data to a text file, but I'm trying
I'm trying to edit this submit tag to make it disable itself once I
Im trying to submit a specific form programatically, but I allways get the initial
I'm trying to submit a form (it's a dynamic form with fields added via
I'm trying to submit a form entry with an uploaded file, but I can't
I'm trying to submit a form when a select changes using jQuery Mobile. I
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I am trying to submit a form with method GET and action index.php?id=3. The

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.