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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:14:14+00:00 2026-06-16T22:14:14+00:00

I have a MySQL database with the following structure: Table1 UniqueID (int) (PrimaryKey &

  • 0

I have a MySQL database with the following structure:

Table1

  • UniqueID (int) (PrimaryKey & AutoIncrement)
  • TitleID (varchar)
  • DescriptionID (varchar)
  • ContentRating (varchar)

Table2

  • UID (int) (PrimaryKey & AutoIncrement)
  • Activity (varchar)
  • ContentLimit (varchar)

What I want to do is take the value from ContentLimit (in Table2) and compare it against (ContentRating) in Table1, if they match then show all the rows that match. I’m using PHP and MySQL to achieve this.

Below is an Example:

Table1

UniqueID | TitleID | DescriptionID | ContentRating
------------------------------------------------------
1        |  Hello  | I Am Text     | Universal
2        |  Again  | Yet More Text | Universal
3        |  This   | Yet More Text | Universal
4        |  Is     | Yet More Text | Parental Guidance
5        |  Some   | Yet More Text | Universal
6        |  Dummy  | Yet More Text | Parental Guidance
7        |  Text   | Yet More Text | Parental Guidance
8        |  I      | Yet More Text | Parental Guidance
9        |  Think  | Yet More Text | Parental Guidance

Table2

UID | Name        | Activity | ContentLimit
---------------------------------------------
1   | John Smith  | IsActive | Universal
2   | Jane Smith  | IsActive | Universal
3   | Felix Tiger | IsActive | Parental Guidance
4   | Spring Load | InActive | Universal

If “Felix Tiger” was logged in then he would be able to see anything submitted with a “Parental Guidance” rating as well as anything with a “Universal” Rating.

But If “Jane Smith” was logged in then she would only be able to view anything submitted with a “Universal” rating

I apologise if I am unclear and will make clear anything that may be mis-read or hard to understand.

Thank you in advance for any help given.

  • 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-16T22:14:15+00:00Added an answer on June 16, 2026 at 10:14 pm

    Try this:

    SELECT 
        a.*, 
        b.* 
    FROM table1 a 
    JOIN table2 b ON a.ContentRating = b.ContentLimit
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my MySQL database, I have a table with structure username - varchar insert_time
I have a MySQL database with the following table structure: TransactionType : Transaction_Amount, Transaction_ID,
I want a mysql query for following scenario I have following database structure 1]
I have the following MySQL database: |deal_name|price|shop|expiration_date - - - - - - -
I have a MySQL innodb database at 1.9GB, showed by following command. SELECT table_schema
I have the following two tables in my mysql database. Table Name: groups id
In my mysql database I have the following information in a page name field.
I have the following task: there are a simple table from mysql database: <html>
I have the following serialized PHP array stored in a mySQL database: a:2:{i:2070;s:4:0.00;i:1901;s:4:1.00;} Now,
I have following query and data saved in a MySQL database with a timestamp

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.