PHP interesse |
|
Ik wil graag een overzicht maken waarbij per datum de nieuwsberichten bij elkaar komen te staan,
zoiets
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
--------------------------
newsitemdate
newsitemtitel (newsitemid)
-------------------------------
newsitemdate
newsitemtitel (newsitemid)
newsitemtitel (newsitemid)
newsitemdate newsitemtitel (newsitemid) newsitemtitel (newsitemid) newsitemtitel (newsitemid) -------------------------- newsitemdate newsitemtitel (newsitemid) ------------------------------- newsitemdate newsitemtitel (newsitemid) newsitemtitel (newsitemid)
maar ik kom er niet helemaal uit, wat doe ik verkeerd?
<?php
include_once('inc_afconnect.php');
$newsitems = mysql_query("
SELECT
n.NewsItem_seasonID AS seasonid,
s.Season_Name AS seasonname,
DATE_FORMAT(n.NewsItem_Date, '%m') AS newsitemmonth,
DATE_FORMAT(n.NewsItem_Date, '%d-%m-%Y') AS newsitemdate,
DATE_FORMAT(n.NewsItem_Time, '%H:%i') AS newsitemtime,
n.NewsItem_Titel AS newsitemtitel,
n.NewsItem_ID AS newsitemid
FROM
newsitems n, af_seasons s
WHERE
n.NewsItem_seasonID =105
AND
n.NewsItem_seasonID= s.Season_ID
AND
NewsItem_Publist='Y'
GROUP BY
newsitemdate
ORDER BY
NewsItem_Date desc,
NewsItem_Time desc
LIMIT 0, 35") or die(mysql_error());
while($record = mysql_fetch_array($newsitems))
{
echo'<h4>'.$record['newsitemdate'].'</h4>';
while($record = mysql_fetch_array($newsitems))
{
echo'<hr>';
echo'<h4>'.$record['newsitemtitel'].'</h4>';
}
}
?>
<?php include_once('inc_afconnect.php'); SELECT n.NewsItem_seasonID AS seasonid, s.Season_Name AS seasonname, DATE_FORMAT(n.NewsItem_Date, '%m') AS newsitemmonth, DATE_FORMAT(n.NewsItem_Date, '%d-%m-%Y') AS newsitemdate, DATE_FORMAT(n.NewsItem_Time, '%H:%i') AS newsitemtime, n.NewsItem_Titel AS newsitemtitel, n.NewsItem_ID AS newsitemid FROM newsitems n, af_seasons s WHERE n.NewsItem_seasonID =105 AND n.NewsItem_seasonID= s.Season_ID AND NewsItem_Publist='Y' GROUP BY newsitemdate ORDER BY NewsItem_Date desc, NewsItem_Time desc { echo'<h4>'.$record['newsitemdate'].'</h4>'; { echo'<h4>'.$record['newsitemtitel'].'</h4>'; } } ?>
|