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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:02:01+00:00 2026-05-17T22:02:01+00:00

I am creating a site much like a wordpress blog whereby the front page

  • 0

I am creating a site much like a wordpress blog whereby the front page will display a post loop: with the post_summary, author info, and tags.

I have four tables:

posts | users | tags | tag relationships

to display all the results i would need to do multiple JOINs for in the SELECT statement

However, to stay with the MVC pattern, there should be a model for each table ( or object ?). So my question is: If I were doing a SELECT all, how would I do this and still keep with the MVC pattern?

To get all the required info for the post, I need the author_id to get my info from the users table AND I need the post_id to get the tags (and so on). If all of my queries are in different Models, what is the best way to perform the query?

Do I make one Model that does all of the JOINS and just use it? Should I load Models from the view? Or should I do additional query work in the Controller?

  • 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-17T22:02:02+00:00Added an answer on May 17, 2026 at 10:02 pm

    I think you have a misunderstanding of the purpose of Models. Models are to deal with data in your database and are not limited to 1 table per model. If you are creating a blog, you will really just need one model. Take a look at the tutorial on the codeigniter website, http://codeigniter.com/tutorials/watch/blog/, and reread the user guide for models, http://codeigniter.com/user_guide/general/models.html .
    You may be getting MVC confused with an ORM

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

Sidebar

Related Questions

I am creating a site which you can post reminders. I have tried much,
I am creating a site for me only that will run from my server.
I am creating MVC3 Site and using pagination (using PagedList;) in that to display
For my site I am using a login system much like the one on
I'm creating a UI with sliding panels much in the fashion of this site:
I'm creating a site using a photo slider like http://www.queness.com/resources/html/scroll/horizontal.html and here is my
I am creating site with php. On localhost all works well. On my hosting
I creating a site in JRuby on Rails (JRuby 1.3.0 ). I am using
I am creating a site and want to have individual pages for each row
I'm creating web site in asp.net web forms. I added validation to fields in

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.