php - A logical problem with two tables -


Hey guys, I have made a list for fixtures.

mysql_query ("<"> <"date selected by date" .TBL_FIXTURES. "Where compname = '$ comp_name' group" date "); $ I = 1; $ D = "Start"; While ($ line = mysql_fetch_assoc ($ result)) {$ odate = $ line ['date']; $ Date = date ("FJY", $ line ['date']); Echo "& lt; p & gt; Stability $ i - $ d to $ date & lt; / p & gt;"; }

As you can see from the query, the date is displayed from the fixtures table. The way my system works is that when "steady" is played, it is removed from this table so that when the whole round fixtures are completed, there is no date for that round in this table. Was there. They will be in the second table.

Anyway, if I can run another query for the dates at the same time, and there is no date in the results table, then can I display the date from the fixtures table?

  "SELECT * FROM" .TBL_CONF_RESULTS "Where compiled = '$ _GET [id]' and amp; type2 = '2' order date"  

this will be the second query!

Edit from here ...

Can any one select a date from two tables and then use only one if there are matches then my query Use the lines of dates to fill (grouped by)? Is this possible?

It looks as if you want two result set union, similar to the following:

< Pre> SELECT f.date to tbl_fixtures f where f.compname = '$ comp_name' select the union from r.date to tbl_conf_results r where r.compid = '$ _get [id]' and r.type2 = '2' Select the group's date and the rows from r.date which are not already in the result set (at least this T-SQL). Apparently this may not be well, but there are many blogs on it (Search: Union T-SQL).


Comments