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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:10:49+00:00 2026-06-06T03:10:49+00:00

I was wondering it is a good idea to creat one object (one class)

  • 0

I was wondering it is a good idea to creat one object (one class) at PHP for each table on the DB.

I have for example 3 tables: user, video, rating

Rating is just a table with idUser, idVideo and the rating the user gives to the video.
Lets say, its a relation with an attribute converted to table on the DB.

I have created two classes at my system: user, video

Should i create another class for rating? Or i should get the rating info through a method inside user or video?

  • 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-06T03:10:50+00:00Added an answer on June 6, 2026 at 3:10 am

    Yes, create a class.

    Even if the advantages are not obvious right away, it will be very useful when you will have to add other attributes like “DateVoted” for example.

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

Sidebar

Related Questions

First i was wondering if this is a good idea, essentially i have user
I was wondering if it is a good idea to create an object using
I was just wondering if it's a good idea to do this. For example
I was wondering, when making your own static library, is it a good idea
I'm just wondering if it is a good idea to make a data structure
I am wondering if it is a good idea to rely on frameworks like
I was wondering if it were a good idea to use an initializer list
I've been wondering whether transparent implicit conversions are really such a good idea and
I've been wondering whether transparent implicit conversions are really such a good idea and
After playing around with AMD/RequireJS I was wondering if it is a good idea

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.