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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:52:36+00:00 2026-06-03T15:52:36+00:00

I have 2 tables. My tables are as below. I have as script called

  • 0

I have 2 tables. My tables are as below. I have as script called getTag.php. The idea being a user wants to see all portfolio items I have tagged with say, php. However, I don’t just want to do:

SELECT t.portfolio_item_id, p.*
FROM tags t
INNER JOIN portfolio p ON t.portfolio_item_id = p.id
WHERE t.$skillArea = '1'

I want to also get all the columns for the tag table too and join them on. So if php =1 in the tag table, get the rest of the columns in the tag table and their values too along with corresponding portfolio item row in portfolio table

  • Portfolio

    id
    item_name
    url

  • tags

    portfolio_item_id
    php
    html
    design
    CSS

    etc…

  • 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-03T15:52:38+00:00Added an answer on June 3, 2026 at 3:52 pm
    SELECT t.*, p.*
    FROM tags t
    INNER JOIN portfolio p ON t.portfolio_item_id = p.id
    WHERE t.$skillArea = '1'
    

    You could just do SELECT * too but I have included t and p to demonstrate where you went wrong.

    • t is the alias for the tags table
    • p is the alias for the portfolio table

    • t.* brings back all columns from the tags table

    • p.* brings back all columns from the portfolio table

    You had t.portfolio_item_id which would only bring back 1 column, where * is a wildcard which is used return all columns in that table.

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

Sidebar

Related Questions

I have created the SQL script below that creates four tables and inserts data
I have to related tables like in the example script below: -- Creating table
I have php login script that I have modified with htm tables and css.
i have four tables like below in sql server 2008 : TABLE 1 ->
I have a problem. I have 3 tables like below: 1) met_ID (primair) etc.
I have three tables specifying important columns below Users(Id, username) Groups(Id, groupname, creator) (creator
I have 3 tables with values like below **tbl_product** recID pID price colour 1
I have two tables like the ones below. I need to find what exchangeRate
I have 10 tables in my database(MySQL). two of them is given below tbl_state
I have two tables names book_list and book_category . Schema is like below: book_list

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.