Forum Moderators: coopster
I am with a problem not do not manage to solve. It is a little complicated of explain, because of this I put two image. One as it is staying and another how I wanted stayed.
As it is staying:
<day title repeats for every article>
As that wanted stayed:
<day title only once with articles grouped underneath>
In other words, it wanted all the day article X stayed with only a title, and not so that each day generated a different day. Below it follows script that I am using:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<?php
$query = mysql_query("SELECT * FROM articles") or die(mysql_error());
while($f = mysql_fetch_array($query)){
$id = $f["id"];
$day = $f["day"];
$title = $f["title"];
?>
<table width="482" border="0" cellspacing="3" cellpadding="0">
<tr>
<td> Day: <?=$day;?></td>
</tr>
</table>
<table width="482" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="21" align="center"><input type="checkbox" name="checkbox" value="checkbox" /></td>
<td width="255"><?=$title;?></td>
</tr>
</table>
<?php
}
?>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sorry my bad English.
Please Help me
Thanks
[edited by: jatar_k at 2:54 pm (utc) on May 15, 2006]
[edit reason] removed links [/edit]
if next day!= last day echo title
or in code
<?php
$query = mysql_query("SELECT * FROM articles") or die(mysql_error());
$lastday = '';
while($f = mysql_fetch_array($query)){
$id = $f["id"];
$day = $f["day"];
$title = $f["title"];
if ($day!= $lastday) {
?>
<table width="482" border="0" cellspacing="3" cellpadding="0">
<tr>
<td> Day: <?=$day;?></td>
</tr>
</table>
<? }?>
<table width="482" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="21" align="center"><input type="checkbox" name="checkbox" value="checkbox" /></td>
<td width="255"><?=$title;?></td>
</tr>
</table>
<?php
$lastday = $day;
}
?>
something like that