repeat repeat repeat
Posted: Sat Jan 04, 2003 8:34 am
right....
i have a problem... 1st lets look at the code...
news_inc.php
----------------------
news_mini.php
----------------------
right and now look at the results at http://www.sonicfusion.co.uk
why are the types repeting how can i make it so each type only appears once?
thanks in advance
p.s. replies in noobie language if possible please
i have a problem... 1st lets look at the code...
news_inc.php
----------------------
Code: Select all
<?php
<?
include('HIDDEN FOR SECURITY');
mysql_pconnect("$host","$user","$pass");
mysql_select_db("$base");
$news_inc_result = mysql_query("SELECT `type` FROM `tbl_sf_news` ORDER BY `type` ASC");
while($news_inc=mysql_fetch_array($news_inc_result
))
{
$type=$news_inc["type"];
include('inc/news_mini.php');
}
?>
?>news_mini.php
----------------------
Code: Select all
<?php
<?
/* $type = ''; required before include*/
include('HIDDEN FOR SECURITY');
echo("$type:<br>");
mysql_pconnect("$host","$user","$pass");
mysql_select_db("$base");
$news_mini_result = mysql_query("SELECT `id`,`title` FROM `tbl_sf_news` WHERE 1 AND `type` LIKE '$type' ORDER BY `date` ASC LIMIT 0, 3");
while($news_mini=mysql_fetch_array($news_mini_resu
lt))
{
$id=$news_mini["id"];
$title=$news_mini["title"];
$date=$news_mini["date"];
echo("<a href='http://www.sonicfusion.co.uk/news.php?id=$id'>//$title - $date</a><br>");
}
echo("<br>");
?>
?>why are the types repeting how can i make it so each type only appears once?
thanks in advance
p.s. replies in noobie language if possible please