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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:40:45+00:00 2026-06-14T03:40:45+00:00

The single query for title works, but more than one song with the title

  • 0

The single query for title works, but more than one song with the title exist. so the new query that includes artist doesn’t work. ALthough EXACT search for the song title is correct and works with single query.

what am i doing wrong

            //$checkTitle = mysql_query("SELECT * from lyrics WHERE title = '$querytitle'");
            $checkTitle = mysql_query("SELECT * FROM lyrics WHERE artist = '$queryArtist' AND title = '$queryTitle'");
            $result = mysql_fetch_array($checkTitle);
            if (!$checkTitle) {
                die('Query Failed');
            } 
            if ($result['title'] == $querytitle)  {
            ?><div id='message'>Song Titled Already Exist <?php echo $cleanTitle; ?> by Artist : <? echo $artist; ?></div><br><br><?
            } else {
            ?><div id="message">Song Titled : <?php echo $cleanTitle; ?> has been added to the database! - <a href="<?php echo $siteURL; ?>artist.php?aid=<?php echo $artist; ?>" target="_Blank">View Artist Page</a></div><br /><br /> <?php echo $queryArtist; ?><?
            print_r($result); // the data returned from the 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-06-14T03:40:46+00:00Added an answer on June 14, 2026 at 3:40 am

    I see you never figured it out from the other question you posted. Try using this query:

    SELECT * FROM lyrics WHERE artist = '$artist' AND title = '$queryTitle'
    

    Then, if you are expecting only one result, you can use something like this to utilize it:

    $query = "SELECT * FROM lyrics WHERE artist = '$artist' AND title = '$queryTitle'";
    $checkTitle = mysql_query($query);
    // assuming you have one result:
    $row = mysql_fetch_array($checkTitle)
    if ($row['title'] == $querytitle) {
        echo "<div id='message'>Song Titled Already Exist $cleanTitle by Artist : $cleanTitle</div><br><br>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yesterday I have been testing one single query for over hours and hours, but
Please help me figure a single query that will transform the data below... |id
I couldn't find a single query that would give me in API 2.0 of
I'm trying to write a single query which will include one of the two
How can I do one single query with both an INSERT and SELECT in
I'm trying to combine info from two different logs into a single query, but
I have two tables described below. What I need is a single query that
That title is brutal, but I don't know how else to put it. I
Apparently ColdFusion doesn't like multiple SQL statements within a single query... so what once
okay, my problem is a little bit more difficult than the title would tell...

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.