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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:24:47+00:00 2026-06-08T06:24:47+00:00

I am very new to PHP and am trying to find the best solution

  • 0

I am very new to PHP and am trying to find the best solution to my problem. In my database I have a field “painters”. Within painters I have “painter A”, “Painter B”,and “Painter C”. Is their a way to display painter c if certain art work comes up? Or Painter “B”, if a certain art work comes up? I am trying to understand the best way to do something like this dynamically. Any links, code, or tutorials would help me tremendously!
Thanks so much in advance!

-Mike

  • 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-08T06:24:49+00:00Added an answer on June 8, 2026 at 6:24 am

    You are going to want 3 tables. A “Painters” table, a “assoc” table, and a “Painting” table.

    Painters table includes:

    • ID
    • Name
    • DOB
    • Phone
    • Address
    • Blah
    • blah

    Painting table includes:

    • ID
    • Name
    • Date_Created
    • Blah
    • Blah
    • Blah

    Assoc table links them… It looks like:

    • ID
    • PAINTER_ID
    • PAINTING_ID

    So you can say SELECT PAINTING_ID FROM ‘ASSOC’ WHERE PAINTER_ID = ‘$Your_variable’
    Then with that result set iterate through that array with a foreach.

    Inside that foreach: you will
    SELECT * FROM PAINTINGS WHERE ID = Array[‘PAINTING_ID’].

    That’s a basic associative relational database.

    You can google more about it, but that’s the basics that should get you started

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

Sidebar

Related Questions

I'm relatively new to PHP and have exhausted the internet trying to find an
I'm very new to PHP so far and have been trying to learn it.
I'm very new to PHP and I have a small task of displaying a
i am relatively new to php and i've encountered a very strange problem. let
I am very new to php, and I am trying to develop a facebook
I am very new to jQuery, I am customizing my PHP project and trying
I am very, very new at PHP and I am trying to fix a
I am very new to PHP and trying to select data from a MySQL
I am very new to PHP, trying to write a script which connects to
I'm very new to RoR, moving from PHP. I have what I hope is

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.