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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:29:15+00:00 2026-06-04T02:29:15+00:00

How it works: Clicking on the album will take you to album.php?id=# //initialize some

  • 0

How it works: Clicking on the album will take you to “album.php?id=#”

//initialize some vars
$albumID = '';

//check what photo we are looking for
if(isset($_GET['id'])){
    $albumID = mysql_real_escape_string($_GET['id']);

Query:

$sql = mysql_query(
SELECT *
FROM albums
JOIN songs
ON albums.performer=songs.performer
WHERE albums.albumID='albumID'
);

What I was trying to accomplish is have it display the album and tracklist. Does anybody know how I should fix this problem? Thank you.

  • 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-04T02:29:17+00:00Added an answer on June 4, 2026 at 2:29 am

    Start by placing your query in a string:

    $query = "SELECT * FROM albums JOIN songs ON albums.performer=songs.performer";
    

    Then, if an album is present, add to that query:

    if ( !empty( $albumID ) ) {
      $query = $query . " WHERE albums.albumID = $albumID";
    }
    

    At this point, we can go ahead and run the query:

    $result = mysql_query( $query ) or die( mysql_error() );
    

    We run the query, using mysql_query, and pass its results into the $result variable. If anything goes wrong, like an error in our query, our program will die, and the most recent mysql_error() will be printed to the screen.

    With our $result variable, we can now cycle through and print the results:

    while ( $row = mysql_fetch_object( $result ) ) {
      echo $row->columnA
    }
    

    Note that columnA is a placeholder, where you should actually write the column name(s) you have stored in your database.

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

Sidebar

Related Questions

When clicking on submit button, ajax works and php page called (no refresh) ,
I am enabling multiple row selection with clicking checkbox Item renderer. this works for
This works but for some reason the comma is missing. data gets inserted as
The following code works fine in FF, but doesn't in IE7 - when clicking
When I try to run the program everything works except clicking the button. When
Any idea why java -jar jarname.jar works, but double clicking the jar gives a
I've got some JQuery which works fine. It loads all the autocomplete values, and
I'm already using a plugin to handle the CSS3 attribute. It works when clicking
I have a video slider that works by clicking a thumbnail and then playing
I work on Asp.Net VS08 C#. Clicking on Button want to show popup. popup

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.