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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:42:25+00:00 2026-06-18T01:42:25+00:00

I am making a product database for my website. I currently have: Products Table:

  • 0

I am making a product database for my website. I currently have:

Products Table: Product ID, Product name, Price

Product_meta Table: Pmeta_id, Product ID, metaKey, metaValue

I basically want it so I can query a product by specifying the meta key and either put a key=>value pair to it, or get the value by the key.

I believe WordPress has a similar approach but am not quite sure how to go about making the functions to get the data. I assume it will involve table joins???

Any help would be appreciated.

  • 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-18T01:42:26+00:00Added an answer on June 18, 2026 at 1:42 am
    SELECT * FROM Product_meta AS M
    LEFT OUTER JOIN Products AS P ON ( P.Product_ID = M.Product_ID )
    WHERE M.metaKey = ...
    

    Or turn it around if the Products table is leading:

    SELECT * FROM Products AS P
    LEFT OUTER JOIN Product_meta AS M ON ( P.Product_ID = M.Product_ID )
    WHERE M.metaKey = ...
    

    You can also change LEFT OUTER JOIN to INNER JOIN when you only want to display the records that are both in the Products table and in the Product_meta table

    If you want to have more than one value in the WHERE clause then use this query:

    ... WHERE M.metaKey IN (..,..,..)
    

    Make sure your data is comma seperated

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

Sidebar

Related Questions

I am making a scraper which is scraping product price and i need to
I have a table in a SQL Server 2005 Database that is used a
I have product tables in my database like below: shop1_products shop2_products shop3_products ..... ....
I have the following table that fetches data from the database: while($row = mysql_fetch_array($result))
I have e following schema PRODUCT(ID,Name,Description) TAG(ID,Label) Product will have about 1000000 records, Tag
I am currently working on a website. I have been asked to be able
I am designing database for jewellery website in which a lot of products will
The Magento Sample Data product database has ~150 products in it. I'm using a
I'm making a web page in which I have a list of products, along
It seems that one template from Products.Five (manage_interfaces) has a bad i18n markup, making

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.