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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:52:08+00:00 2026-06-05T09:52:08+00:00

High guys,I have three models that i am using in Cakephp,I create 3 views

  • 0

High guys,I have three models that i am using in Cakephp,I create 3 views for my models which are linked by the second model.The problem is how can i retrieve the id of the first model when i want to do a final save?

  • 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-05T09:52:10+00:00Added an answer on June 5, 2026 at 9:52 am

    Under the assumption that you’re saving the three models in three separate page requests, it should suffice to simply store the saved model data in your session. That way you can read it in the 2nd and 3rd page request and include the necessary data in your forms and processing.

    If you’re doing it all in the same request, then Moyed’s idea works, you can get the ID of a saved row through the model:

    $this->Model->save($data);
    $saved_row_id = $this->Model->id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

High Guys, I have to define a polymorphic datatype for a tree that can
So, I have a problem. Basically, I didn't pay enough attention in high school
So I have a website that could eventually get some pretty high traffic. My
I have about 20-ish high quality images (~3840x5800 px) that I need to load
I am using Xcode to create a Mac OSX, Objective-C, cocoa app. I have
High Level With StructureMap, Can I define a assembly scan rule that for an
The high level problem we're having is this. We've got Apache Wave installed and
I have searched high and low for documentation on how to use this feature.
I've searched high and look for samples about using MEF for DI. I know
I've been searching high and low for an Eclipse feature that lets you right-click

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.