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

  • Home
  • SEARCH
  • 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 865603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:39:49+00:00 2026-05-15T09:39:49+00:00

Hey guys, I created a list for fixtures. $result = mysql_query(SELECT date FROM .TBL_FIXTURES.

  • 0

Hey guys, I created a list for fixtures.

$result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date");
    $i = 1;
    $d = "Start";
    while ($row = mysql_fetch_assoc($result)) 
    {
        $odate = $row['date'];
        $date=date("F j Y", $row['date']);
        echo "<p>Fixture $i - $d to $date</p>";
    }

As you can see from the query, the date is displayed from the fixtures table.
The way my system works is that when a fixture is “played”, it is removed from this table. Therefore when the entire round of fixtures are complete, there wont be any dates for that round in this table. They will be in another table.

Is there anyway I can run an other query for dates at the same time, and display only dates from the fixtures table if there isnt a date in the results table?

"SELECT * FROM ".TBL_CONF_RESULTS." 
                               WHERE compid = '$_GET[id]' && type2 = '2' ORDER BY date" 

That would be the second query!

EDIT FROM HERE ONWARDS…

Is there anyway I can select the date from two tables and then only use one if there are matches. Then use the rows of dates (GROUPED BY) to populate my query? Is that possible?

  • 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-15T09:39:49+00:00Added an answer on May 15, 2026 at 9:39 am

    It sounds like you want to UNION the two result sets, akin to the following:

    SELECT f.date FROM tbl_fixtures f
    WHERE f.compname = '$comp_name'
    UNION SELECT r.date FROM tbl_conf_results r
    WHERE r.compid = '$_GET[id]' AND r.type2 = '2'
    GROUP BY date
    

    This should select f.date and add rows from r.date that aren’t already in the result set (at least this is the behaviour with T-SQL). Apparently it may not scale well, but there are many blogs on that (search: UNION T-SQL).

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

Sidebar

Related Questions

Hey guys, I've created a CustomFileUpload class which is inherited from the original FileUpload
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
Hey guys, I want to store a categorized list of URLs. This is an
Hey Guys, here is my code for this, the only help i get from
Hey Guys I have four integer array lists which were created after parsing a
Hey guys i have two date inputs containing three dropboxes for day,month and year
Hey guys, I have an application that I want to display some data from
Hey guys I wanted to know if I get get some advice from some
Hey guys i have created an app which is hosted in my localhost. No
Hey guys hoping for a little help here. First I created a working map

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.