
also ich würd gerne die neusten Kommentare auf der startseite anzeigen lassen, was auch hervorragend klappt *g* aber der sortiert mir`s nicht nach den letzten/neusten 5 kommentaren irgendwie und ich blicks ned, wieso ned *g*
das is die funktion, die ich benutz:
Code: Select all
function generateKom() {
global $db, $sqltblpre;
$result = $db->query("SELECT DISTINCT ".$sqltblpre."faqcomments.id, ".$sqltblpre."faqcomments.user, ".$sqltblpre."faqcomments.email, ".$sqltblpre."faqcomments.comment, ".$sqltblpre."faqcomments.datum, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.id FROM ".$sqltblpre."faqcomments, ".$sqltblpre."faqdata WHERE ".$sqltblpre."faqcomments.id = ".$sqltblpre."faqdata.id ORDER BY ".$sqltblpre."faqcomments.datum DESC LIMIT 0,5");
if ($num = $db->num_rows($result) > 0) {
$output = "";
while ($row = $db->fetch_object($result)) {
$output .= "\t\t<tr>\n";
$output .= "\t\t\t<td valign=\"top\" class=\"fivenewest\"><a href=\"".$row->email."\">".stripslashes(makeShorterText($row->thema, 4))."</a></td>\n";
$output .= "\t\t\t<td valign=\"top\" class=\"fivenewest\"><a href=\"mailto:".$row->email."\">".$row->user."</a></td>\n";
$output .= "\t\t\t<td valign=\"top\" class=\"fivenewest\" nowrap>".stripslashes(makeShorterText($row->comment, 9))."</td>\n";
$output .= "\t\t</tr>\n";
}
}
else {
$output = "<tr class=\"fivenewest\"><td>Keine Kommentare</td></tr>";
}
return $output;
}