Funjoy
Erfahrenes Mitglied
Hallo,
Ich habe ein kleines Problem bei mein eigenem Board! Undzwar versuche ich nun schon seit ca. 3 Std meine Foren in der zugewisenen Kategorie unter zu Bringen doch derzeit komm immer Folgendes Ergebnis aus:
Kategorie1
-Board1
Kategorie2
-Board2
Kategorie2
-Board3
sollte aber so aussehen:
Kategorie1
-Board1
Kategorie2
-Board2
-Board3
Ich habe derzeit zwei Tabellen erstellt
Tabelle 1 = px1_category:
Tabelle 2 = px1_subboards:
und in meiner Index steht:
Mit dem Code komm ich immer nur zu der Ausgabe:
Kategorie1
-Board1
Kategorie2
-Board2
Kategorie2
-Board3
Kann mir da wer helfen ich bin hier schon am verzweifeln ?
MfG Funjoy
Ich habe ein kleines Problem bei mein eigenem Board! Undzwar versuche ich nun schon seit ca. 3 Std meine Foren in der zugewisenen Kategorie unter zu Bringen doch derzeit komm immer Folgendes Ergebnis aus:
Kategorie1
-Board1
Kategorie2
-Board2
Kategorie2
-Board3
sollte aber so aussehen:
Kategorie1
-Board1
Kategorie2
-Board2
-Board3
Ich habe derzeit zwei Tabellen erstellt
Tabelle 1 = px1_category:
Code:
#
# Tabellenstruktur für Tabelle `px1_category`
#
CREATE TABLE `px1_category` (
`catid` int(11) NOT NULL auto_increment,
`sort` int(11) NOT NULL default '0',
`name` varchar(150) NOT NULL default '',
`subject` text NOT NULL,
`invisible` int(1) NOT NULL default '0',
PRIMARY KEY (`catid`)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
#
# Daten für Tabelle `px1_category`
#
INSERT INTO `px1_category` VALUES (1, 1, 'Kategorie1', 'Text...........', 0);
INSERT INTO `px1_category` VALUES (2, 2, 'Kategorie2', 'Text..............', 0);
Tabelle 2 = px1_subboards:
Code:
#
# Tabellenstruktur für Tabelle `px1_subboards`
#
CREATE TABLE `px1_subboards` (
`boardid` int(11) NOT NULL auto_increment,
`subid` int(11) NOT NULL default '0',
`sort` int(11) NOT NULL default '0',
`name` varchar(150) NOT NULL default '',
`subject` text NOT NULL,
PRIMARY KEY (`boardid`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;
#
# Daten für Tabelle `px1_subboards`
#
INSERT INTO `px1_subboards` VALUES (1, 1, 1, 'Board1', 'Text.............');
INSERT INTO `px1_subboards` VALUES (2, 2, 1, 'Board2', 'Text.............');
INSERT INTO `px1_subboards` VALUES (3, 2, 2, 'Board3', 'Text...............');
und in meiner Index steht:
PHP:
<?php
require("require/mysql.config.php");
require("require/_function.php");
require("require/_global.php");
$bordercolor= "#999999";
$border= "1px";
$borderstyle= "solid";
$table_bgcolor= "#F5F5F5";
$title="PX-Board";
sql_connect();
if(empty($_POST['target']) || $_POST['target'] =="home"){
$result_01 = mysql_query("SELECT * FROM ".$tbname."_subboards ORDER BY sort ASC");
while($subboards = mysql_fetch_array($result_01)){
$result_02 = mysql_query("SELECT * FROM ".$tbname."_category WHERE catid='".$subboards['subid']."' ORDER BY sort DESC");
$category = mysql_fetch_array($result_02);
//////// Kategorie ausgeben! ////////
if(!empty($category['subject'])) $cattext2 = "<br><font size=\"-2\"> ".$category['subject']."</font>";
if($category['catid'] == $subboards['subid'])$content_boards .="<tr><td colspan=\"4\" width=\"100%\" bgcolor=\"$bordercolor\"> <b>".$category['name']."</b>".$cattext2."</td></tr>";
//////// Boards ausgeben! ////////
if(!empty($subboards['subject'])) $cattext = "<br><font size=\"-1\"> ".$subboards['subject']."</font>";
if($subboards['subid'] == $category['catid']){
$content_boards .="<tr><td width=\"50%\" style=\"BORDER: $border $borderstyle $bordercolor; BORDER-TOP:none; BORDER-BOTTOM:none;BORDER-LEFT:none;\"> <a href=\"#\">".$subboards['name']."</a>".$cattext."</td>"
."<td width=\"10%\" align=\"center\" style=\"BORDER: $border $borderstyle $bordercolor; BORDER-TOP:none; BORDER-BOTTOM:none;BORDER-LEFT:none;\">0</td>"
."<td width=\"10%\" align=\"center\" style=\"BORDER: $border $borderstyle $bordercolor; BORDER-TOP:none; BORDER-BOTTOM:none;BORDER-LEFT:none;\">0</td>"
."<td width=\"30%\"> <a href=\"#\">Variable</a></td></tr>"
."<tr><td width=\"100%\" colspan=\"4\" bgcolor=\"$bordercolor\"></td></tr>";
}
}
}
eval("dooutput(\"".gettemplate("index")."\");");
?>
Mit dem Code komm ich immer nur zu der Ausgabe:
Kategorie1
-Board1
Kategorie2
-Board2
Kategorie2
-Board3
Kann mir da wer helfen ich bin hier schon am verzweifeln ?
MfG Funjoy