Sonnenspeer
Registriert: 15.05.2008
eBN-Alter: 2J 3M 20T
Beiträge: 115
Verwarnungen: 0
eBytes: 195.94
|
Titel: Fußball PHP-System
Hallo 
Ich bin zur Zeit an einem Projekt, dass sich um das Thema Fußball dreht.
Hierzu habe ich schon einiges fertig und nun will ich ein Script schreiben, bei dem man nur die Ergebnisse eintragen muss und somit wird automatisch alles ausgewertet und die Tabelle neu konfiguriert.
Folgenden Scriptteil besitze ich schon:
Auszug aus dem Export der Datenbank:
Code:--
-- Tabellenstruktur für Tabelle `tabelle`
--
CREATE TABLE IF NOT EXISTS `tabelle` (
`name` varchar(255) NOT NULL,
`won` int(255) NOT NULL,
`equal` int(255) NOT NULL,
`loose` int(255) NOT NULL,
`goals` int(255) NOT NULL,
`goals_get` int(255) NOT NULL,
`different` int(255) NOT NULL,
`points` int(255) NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Daten für Tabelle `tabelle`
--
INSERT INTO `tabelle` (`name`, `won`, `equal`, `loose`, `goals`, `goals_get`, `different`, `points`) VALUES
('VfL Wolfsburg', 0, 0, 0, 0, 0, 0, 0),
('FC Bayern München', 0, 0, 0, 0, 0, 0, 0),
('VfB Stuttgart', 0, 0, 0, 0, 0, 0, 0),
('Hertha BSC Berlin', 0, 0, 0, 0, 0, 0, 0),
('Hamburger SV', 0, 0, 0, 0, 0, 0, 0),
('Borussia Dortmund', 0, 0, 0, 0, 0, 0, 0),
('1899 Hoffenheim', 0, 0, 0, 0, 0, 0, 0),
('FC Schalke 04', 0, 0, 0, 0, 0, 0, 0),
('Bayer Leverkusen', 0, 0, 0, 0, 0, 0, 0),
('Werder Bremen', 0, 0, 0, 0, 0, 0, 0),
('Hannover 96', 0, 0, 0, 0, 0, 0, 0),
('1. FC Köln', 0, 0, 0, 0, 0, 0, 0),
('Eintracht Frankfurt', 0, 0, 0, 0, 0, 0, 0),
('VfL Bochum', 0, 0, 0, 0, 0, 0, 0),
('Borussia Mönchengladbach', 0, 0, 0, 0, 0, 0, 0),
('1. FC Nürnberg', 0, 0, 0, 0, 0, 0, 0),
('SC Freiburg', 0, 0, 0, 0, 0, 0, 0),
('1. FSV Mainz 05', 0, 0, 0, 0, 0, 0, 0);
Der dazugehörige Abruf-Teil:
PHP-Code:
<table width="100%">
<thead>
<tr>
<td class="line" width="7%">Platz</td>
<td class="line" width="40%">Verein</td>
<td class="line" width="8%">S</td>
<td class="line" width="8%">U</td>
<td class="line" width="8%">N</td>
<td class="line" width="8%">Tore</td>
<td class="line" width="8%">Diff.</td>
<td class="line" width="8%">Punkte</td>
<td class="line" width="8%"></td>
</tr>
</thead>
<tbody>
<? $bundesliga = mysql_query("SELECT * FROM tabelle ORDER BY points DESC, different DESC");
while($table = mysql_fetch_assoc($bundesliga)) {
?>
<tr class="hover">
<td class="line" width="7%"><? $i; $i++; echo $i; ?></td>
<td class="line" width="40%"><?=$table['name'];?></td>
<td class="line" width="8%"><?=$table['won'];?></td>
<td class="line" width="8%"><?=$table['equal'];?></td>
<td class="line" width="8%"><?=$table['loose'];?></td>
<td class="line" width="8%"><?=$table['goals'].":".$table['goals_get'];?></td>
<td class="line" width="8%"><?=$table['different'];?></td>
<td class="line" width="8%"><?=$table['points'];?></td>
<td class="line" width="8%"></td>
</tr>
<? } ?>
</tbody>
</table>
Nun ist meine Frage wie ich das realisieren kann, dass ich nur die Ergebnisse der Spiele eintragen muss um das ganze automatisch zu aktualisieren.
Gruß
Sonne
Zuletzt bearbeitet von Sonnenspeer am 02.06.2009 um 00:23:01 Uhr
_______________________________
Ansprechpartner in Bezug auf CMS, Foren und Hardware.
Kenntnisse in PHP, HTML und CSS.
|