items groeperen per datum
mar kla
24/09/2010 23:08:55Ik wil graag een overzicht maken waarbij per datum de nieuwsberichten bij elkaar komen te staan,
zoiets dus:
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
--------------------------
newsitemdate
newsitemtitel (newsitemid)
-------------------------------
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
zoiets dus:
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
--------------------------
newsitemdate
newsitemtitel (newsitemid)
-------------------------------
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
include_once "inc_afconnect.php"; //verbinding maken
include_once "inc_affunctions.php"; //verbinding maken
echo'<div class="mainleft"><!--start mainleft-->';
echo'<div class="tabelhead">actueel nieuws</div>';
$querynews=mysql_query("
SELECT
n.NewsItem_ID as newsitemid,
n.NewsItem_Titel as newsitemtitel,
DATE_FORMAT(n.NewsItem_Date, '%d-%m-%Y') AS newsdate
FROM newsitems n
WHERE n.NewsItem_seasonID =105
AND n.NewsItem_Publist='Y'
AND n.Newsitem_OnFrontpage='Y'
AND n.NewsItem_TopNews = 'N'
ORDER BY
n.NewsItem_Date DESC,
n.NewsItem_Time DESC
LIMIT 0, 35") or die(mysql_error());
//$querynews = mysql_query($querynews) or die(mysql_error());
//$num_rows[1] = mysql_num_rows($res[1]);
while($record = mysql_fetch_array($querynews))
{
echo'<hr>';
echo'<h4>'.$record['newsdate'].'</h4>';
echo"<a href='/article/".$record['newsitemid']."/".clean_url($record['newsitemtitel']).".htm' title='".$record['newsitemtitel']."' >".$record['newsitemtitel']."</a>";
}
echo'</div ><!--END actueelnews div -->';
?>
include_once "inc_afconnect.php"; //verbinding maken
include_once "inc_affunctions.php"; //verbinding maken
echo'<div class="mainleft"><!--start mainleft-->';
echo'<div class="tabelhead">actueel nieuws</div>';
$querynews=mysql_query("
SELECT
n.NewsItem_ID as newsitemid,
n.NewsItem_Titel as newsitemtitel,
DATE_FORMAT(n.NewsItem_Date, '%d-%m-%Y') AS newsdate
FROM newsitems n
WHERE n.NewsItem_seasonID =105
AND n.NewsItem_Publist='Y'
AND n.Newsitem_OnFrontpage='Y'
AND n.NewsItem_TopNews = 'N'
ORDER BY
n.NewsItem_Date DESC,
n.NewsItem_Time DESC
LIMIT 0, 35") or die(mysql_error());
//$querynews = mysql_query($querynews) or die(mysql_error());
//$num_rows[1] = mysql_num_rows($res[1]);
while($record = mysql_fetch_array($querynews))
{
echo'<hr>';
echo'<h4>'.$record['newsdate'].'</h4>';
echo"<a href='/article/".$record['newsitemid']."/".clean_url($record['newsitemtitel']).".htm' title='".$record['newsitemtitel']."' >".$record['newsitemtitel']."</a>";
}
echo'</div ><!--END actueelnews div -->';
?>
Gewijzigd op 24/09/2010 23:13:42 door Mar kla