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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:13:54+00:00 2026-06-01T03:13:54+00:00

I have a table in a MySQL table called persons id LastName FirstName 1

  • 0

I have a table in a MySQL table called persons

id  LastName    FirstName
1       Hansen      Timoteivn
2       Svendson    Tove
3       Pettersen   Kari

and another MySQL table called orders.

id  OrderNo  personID
1       77895    3
2       44678    3
3       22456    1
4       24562    1
5       34764    15

How can I write a SQL query that I feed into PHP’s mysql_query() function to return a list of “Order objects” that each contain a “Person object?” Each “Person object” has first name and last name as properties.

  • 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-01T03:13:55+00:00Added an answer on June 1, 2026 at 3:13 am

    this query will return orders by a certain person (this will not give the object)

    SELECT a.ID, a. FirstName, a.LastName, b.OrderNo
    FROM Persons a INNER JOIN Orders b ON
            a.ID = b.PersonID
    WHERE a.ID = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, basically, I have a MySQL table called 'topics' and another one called 'replies',
I have a MySQL table called employees . There's another table called shifts that
I have a mysql table called books that has a votes column, and another
Lets say I have a table in MySQL called articles, that has a column
I have a MySql table called reviews which stores a lot of product reviews,
I have this mysql table called comments which looks like this: commentID parentID type
I have a MySQL table called Users. The rows have 4 fields and look
I have a table in mysql with a row called 'newrelease'. If the item
I have a table in MYSQL with a column called league. When I try
Hi I have a field in mySql table called jobnumber which auto increments with

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.