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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:10:03+00:00 2026-05-23T18:10:03+00:00

I have 3 tables. Table 1 : t_atc_list id | a_name | s_title |

  • 0

I have 3 tables.

Table 1 : t_atc_list

id | a_name | s_title | r_name
------------------------------
80 | ss     | 128     | 5

Where s_title & r_name is foreign key.

Table 2 : t_s_list

s_id | title
-------------
128  | Song Title

Table 3 : t_r_list

r_id | r_name
--------------
5    | Artist

I have used following query to have desired output in this format Song Title- Artist using album name that is a_name

$resultid=mysql_query("SELECT s_title, r_name FROM t_atc_list where a_name='$album' ");
$rowid=mysql_fetch_array($resultid);
$query=mysql_query("SELECT s.title, r.r_name FROM t_a_list as a, t_r_list as r, WHERE s.s_id=$rowid('s_title') and r.r_id= $rowid('r_name')");
$row=mysql_fetch_array($query);
  • 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-23T18:10:04+00:00Added an answer on May 23, 2026 at 6:10 pm

    I think the SQL query you want is:

    SELECT 
        t.id,
        t.a_name,
        s.title as s_title,
        r.r_name
    FROM
        t_atc_list t
            INNER JOIN t_s_list s ON t.s_title = s.s_id
            INNER JOIN t_r_list r ON t.r_name = r.r_id
    WHERE
        t.a_name = '$album'
    

    FWIW, your table naming conventions and your schema in general are pretty wacky. At the very least, what’s wrong with “tracks”, “songs” and “artists”, or whatever they are supposed to be (or for purists, “track”, “song”, “artist”) for your table names?

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

Sidebar

Related Questions

I have two tables CREATE TABLE table1 (id int primary key auto_increment,....); CREATE TABLE
I have 2 tables - first table holds all unique data (columns: title, artist,
I have three tables: Table User( userid username) Table Key( userid keyid) Table Laptop(
So I have three tables: Table Place: _id autoincrement not null primary key, name
I have 3 tables A, B and T T holds a foreign key to
I have three tables: table "package" ----------------------------------------------------- package_id int(10) primary key, auto-increment package_name varchar(255)
I have two tables Table A: ID 1 2 3 4 Table B: ID
First of all I tried this Insert Data Into Tables Linked by Foreign Key
i have two tables: CREATE TABLE public.auctions ( id VARCHAR(255) NOT NULL, auction_value_key VARCHAR(255)
I have three tables. Table (t), a resource in my system. It has a

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.