Servus Jungs,
ich bin grade an einem War script und da will ich anzeigen lassen wieviel Matches unter einer Kategorie gespeichert sind.
MySQL Struktur:
Weiter als das bin ich nicht gekommen, aber er zeigt immer nur 1 an:
Danke schon mal
ich bin grade an einem War script und da will ich anzeigen lassen wieviel Matches unter einer Kategorie gespeichert sind.
MySQL Struktur:
PHP-Code:
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `mega_matches`
--
CREATE TABLE `mega_matches` (
`id` int(11) NOT NULL auto_increment,
`catID` int(11) NOT NULL,
`opponent` varchar(255) collate latin1_general_ci NOT NULL,
`opponent_hp` varchar(100) collate latin1_general_ci NOT NULL,
`date` int(11) NOT NULL,
`xonx` varchar(10) collate latin1_general_ci NOT NULL,
`maps` varchar(255) collate latin1_general_ci NOT NULL,
`players` varchar(255) collate latin1_general_ci NOT NULL,
`description` text collate latin1_general_ci NOT NULL,
`result1` int(11) NOT NULL,
`result2` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=16 ;
--
-- Tabellenstruktur für Tabelle `mega_matches_cats`
--
CREATE TABLE `mega_matches_cats` (
`catID` int(11) NOT NULL auto_increment,
`name` varchar(255) collate latin1_general_ci NOT NULL,
`url` varchar(255) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`catID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=14 ;
PHP-Code:
$result=query("SELECT catID, name, url FROM ".PREFIX."_matches_cats ORDER BY catID DESC");
if(mysql_num_rows($result))
{
while($row = mysql_fetch_assoc($result))
{
$id=$row['catID'];
$name=$row['name'];
$url=trim($row['url']);
$result6=query("SELECT catID, name, url FROM ".PREFIX."_matches_cats WHERE catID=".$id."");
$test=mysql_num_rows($result6);
if($url != "") $url=$row['url']; else $url=" ";
$content .=
"<tr><td width=\"15px\" class=\"line3\"><input type=\"checkbox\" name=\"categories[]\" value=\"$id\"></td>
<td width=\"20px\" class=\"line4\">$id</td>
<td width=\"235px\" class=\"line4\"><a href=\"index.php?site=matches&cID=$id\">$name</a></td>
<td width=\"260px\" class=\"line4\">
<a href=\"http://$url\">$url</a></td>
<td width=\"50px\" class=\"line4\">$test</a></td>"; }
Kommentar