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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:48:49+00:00 2026-06-04T22:48:49+00:00

I know it is a little bit lazy to ask this question here because

  • 0

I know it is a little bit lazy to ask this question here because basically I just need to read the documentation for me to know the answer. But actually I don’t have that much of time, and I’m still a beginner.

I want to produce this kind of query in cakephp:

SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
INNER JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName

but the question is I’m a little bit confused because as you can see you will select values from 2 different tables. So my guess is, I need to create two models for each and controllers. is it a little bit of a hassle?

  • 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-04T22:48:51+00:00Added an answer on June 4, 2026 at 10:48 pm

    What you are wanting to do is is the basic Model Associations provided by CakePHP. http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html

    So yes, you will need to create Models for each, probably have an association so a Person has many orders.

    Further more, with MVC architecture, you will normally have one model per table in your database. Your controller will handle the communication between the Model and the Views. So if don’t need dedicated views for a model, then you might not need Controllers for them.

    I really suggest you go through the Book for CakePHP and do the Blog demo they provide and really try to under the concepts presented for MVC Architecture.

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

Sidebar

Related Questions

I know this question might sound a little bit crazy, but I tough that
I know this sounds a little bit specific but I was just wondering where
I know the title of this question might be a little bit misleading; I
This one is a huge issue: first off, while I know a little bit
I know how to write tab host,but here the scenario is little bit different
I know this has a stupid solution but, sorry, I'm little bit confused. I
I am new to node.js and express.js. I know this is a little bit
I know this may sound silly little bit, but there is no other way
I know I can improvise this little bit (eliminate explicit throw) by using Preconditions
This might spund a little bit funny, didn't even know how to put 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.