PHP-Nuke Nederland: Forums
PHP-Nuke Nederland :: View topic - block-Reviews
Author
Message
kenwood
Moderator
Joined: Sep 07, 2004
Posts: 246
Posted:
Mon 07 Jul 2008 3:09
Op een site gebruk ik block-Reviews maar er wordt nog al eens een dubble review geplaatst.
Nu wilde ik eigenlijk de dubbele posten niet tonen in mijn block op de mianpage en alleen de eerste van elke review.
En de dubbel posten met de zelfde title dus over slaan.
[php]if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $prefix, $db;
$content = '';
$sql = 'SELECT id, title FROM '.$prefix.'_reviews ORDER BY id DESC LIMIT 0,10';
$result = $db->sql_query($sql);
while (list($id, $title) = $db->sql_fetchrow($result)) {
$id = intval($id);
$content .= '<strong><big>·</big></strong> <a>'.$title.'</a><br>';
}
?>[/php]
Dit is de code die ik gebruik voor het block
zeromechanic
Administrator
Joined: Oct 01, 2004
Posts: 1436
Location: Emmeloord
Posted:
Mon 07 Jul 2008 6:29
ff gauw uit het hoofd.
bekijk op de mysql site by de select statement de optie "group by"
kan zijn dat dit voor jou een optie is.
_________________Te Lezen : Forum Regels | Te Gebruiken
kenwood
Moderator
Joined: Sep 07, 2004
Posts: 246
Posted:
Tue 08 Jul 2008 5:35
zeromechanic wrote:
ff gauw uit het hoofd.
bekijk op de mysql site by de select statement de optie "group by"
kan zijn dat dit voor jou een optie is.
Helaas werkt dit niet daar ik dan een vaste variable moet opgeven en die is telkens anders.
BlueLion
Administrator
Joined: Aug 21, 2004
Posts: 2831
Posted:
Tue 08 Jul 2008 8:02
Hoe ziet de tabel eruit?
BL
_________________Te Lezen : Forum Regels | Te Gebruiken : Forum Zoek Functie
Aanbevolen PHP-Nuke versie : PHP-Nuke 7.6pl3.1!
Aanbevolen Security AddOn : Nuke Sentinel™
Donaties
Adverteren
Wilt u het forum steunen, dan kunt u nu eenvoudig doneren met PayPal.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group