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 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 will have a desktop and a mobile theme.
I'm creating a social site for teachers (non-programmers) on which teachers can add events,
Warning: I don't have much experience with CodeIgniter and I am updating a site
I am creating a custom module for a Magento ecommerce site, and the module
I am creating my first site in asp.net MVC and I have a very
I have a slight problem with .htaccess redirect. I have a dynamic site with
When creating a designable .NET component, you are required to provide a default constructor.
If you take a look at Tom Schultz's Blog , you'll see that he
I don't know much about SEO and how web spiders work, so forgive my
I have a design I'm creating in CSS, and it has started to sort

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.