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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:25:11+00:00 2026-05-25T03:25:11+00:00

Hello again community, I posted a question just over an hour ago asking for

  • 0

Hello again community,

I posted a question just over an hour ago asking for some help fixing a SQL query, that was promptly answered and was a great help. Sadly though, upon reflection and further usage, it turns out that the query was returning all rows in the targeted table. I validated this by putting the mysql_fetch_object inside a while loop.

So what I desperately need now is someone to have a look at the SQL query and tell me what is going wrong and if possible how to fix it. I simply just need one row (the correct row) to be found when using $_SESSION[‘model’] as the reference.

Below is the full content of my previous question.

Thank you in advance.

============================================================================

web_quote_models table

id | model       | product_id | cpu_id | ram_id | hdd_id | os_id | opt_id
=========================================================================
1  | 000001      | 1          | 1      | 1      | 1      | 1     | 1
2  | 000002      | 1          | 2      | 2      | 2      | 2     | 2
3  | 000003      | 1          | 3      | 3      | 3      | 3     | 3
4  | 000004      | 1          | 4      | 4      | 4      | 4     | 4

web_quote_component_cpu table

id | name
==========================================================================
1  | Intel® Core™ i3 2100 3.1GHz dual-core
2  | Intel® Core™ i5 2500 2.7GHz quad-core
3  | Intel® Core%trade; i7 2600 3.4GHz 8mb Cache dual-core

So what I need to achieve is a query that will look inside the web_quote_models table and match the model field with a $_SESSION[‘model’] then match the web_quote_models.cpu_id field with the web_quote_component.id.

This is what I have so far; I cant be too far off I think.

("
 SELECT web_quote_component_cpu.name
 FROM web_quote_component_cpu
 LEFT JOIN web_quote_models
 ON web_quote_component_cpu.id=web_quote_models.cpu_id
 AND web_quote_models.name='".$_SESSION['model']."'
");

A massive thank you in advance to anyone that helps.

Dan.

  • 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-25T03:25:12+00:00Added an answer on May 25, 2026 at 3:25 am

    With Left Join, you get entries from the table on the left side of join (that is web_quote_component_cpu) even if they are not matched with the other table. If you want entries that only match, use join instead of left join.

    Is that what you were asking?

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

Sidebar

Related Questions

hello again, WSO2 community. My last question about your architecture for my research is
Hello again, stackoverflow community! I'm working on writing a simple blog system in Rails,
Hello again stackoverflow, I have a question concerning List of Objects. I have tried
Hello again ladies and gents! OK, following on from my other question on ASP.NET
Hello again Stackoverflow community, Today I am trying to execute an application with commandline
hello again my question if it is possible to print microsencods using TimesSpan in
Hello again codes masters, I'm stuck at this piece of codes for dropdown menu.
Hello again everyone, This time I have a problem with Intent & Extras. here's
Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Hello once again stackoverflow folks, this is really hard and it's been torturing my

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.