Hmm.. Im stuck. Cant think it logic..
Hey.
Im re-writing some of this script, hmm. the first is, that.. I have one table for the results and one for the claninfo.
Results & Clans.
In Clans i use cid instead of Results id, but the thing is. when you check teh report i want the right clan (cid?) to fit with the result.
do you get it? how do i do? :> Ive written a add script and so, and it works fine.. now i need to know how to get the right clan info into the "report" stuff.
Cheers
two id's working together..?
Moderator: Moderators
two id's working together..?
Eg har blitt norrbagge :<
Not sure I follow you, but I think you might want to read up on joins.
Example tables (underline denotes primary key):
clans(ClanID,ClanName,ClanWebsite)
results(MatchID,ClanID,ScoreUs,ScoreThem)
Example SQL:
SELECT * FROM results LEFT JOIN clans ON results.ClanID = clan.ClanID;
That should match the clan with the match.
Untested code at 6 AM!
Edit: And lo and behold an obvious error spotted and corrected.
Example tables (underline denotes primary key):
clans(ClanID,ClanName,ClanWebsite)
results(MatchID,ClanID,ScoreUs,ScoreThem)
Example SQL:
SELECT * FROM results LEFT JOIN clans ON results.ClanID = clan.ClanID;
That should match the clan with the match.
Untested code at 6 AM!
Edit: And lo and behold an obvious error spotted and corrected.
Down, not across.
Or just like this.
SELECT * FROM results, clans WHERE results.ClanID = clan.ClanID, ORDER BY MatchID DESC;
SELECT * FROM results, clans WHERE results.ClanID = clan.ClanID, ORDER BY MatchID DESC;
paino on voimaa, ylipaino on ylivoimaa BD http://www.clanunited.org