Page 1 of 1

mad easy quick question

Posted: Thu Feb 12, 2004 7:55 pm
by John Cartwright
How do I merge 2 querys together

$result = @mysql_query("SELECT * FROM records_cal ORDER BY `date` DESC");

and

$result = @mysql_query("SELECT * FROM records_scrim ORDER BY `date` DESC");

Posted: Thu Feb 12, 2004 7:56 pm
by Cruzado_Mainfrm
can you show us what the tables look like?

Posted: Thu Feb 12, 2004 7:57 pm
by John Cartwright
both tables are the exact same

and include this

$date = $row["date"];
$outcome = $row["outcome"];
$league = $row["league"];
$map = $row["map"];
$opponent = $row["opponent"];
$league = $row["league"];

Posted: Thu Feb 12, 2004 8:01 pm
by Cruzado_Mainfrm
i think...

Code: Select all

SELECT * FROM records_cal,records_scrim ORDER BY records_cal.date DESC, records_scrim.date DESC
note: i edited it
note: edited again... after u posted

Posted: Thu Feb 12, 2004 8:36 pm
by John Cartwright
Error performing query: Column: 'date' in order clause is ambiguous

:S

Posted: Thu Feb 12, 2004 9:01 pm
by John Cartwright
This is really weird..

basically my script checks to see which variable is being loaded and depending which one a different queries are loaded.

http://www.jcartonline.com/xe

on the left you will see the records thing and it sais cal-o - info....scrim - info.... total - info.....

check out cal-o and scrim info then look at total... the only different in between these are that a different query is being loaded. They are all running from records.php.. check it out

the total is basically just getting both the queries together, oither than that they r identical scripts but the total is really weird.

Posted: Fri Feb 13, 2004 6:40 am
by John Cartwright
Nvm, when I add records I'm going to make it go into 2 different tables,

For example I'm entering a cal match.

It creates 1 copy in cal_table and 1 copy in total_table .

Seems like the only way @ my skill level