Чет запутался...
Есть опять же две таблицы ...
users и
days_subcription
users по стандарту - id, name, ...
days_subcription
см. pic2
Вот код
<?php
print '<table width="841" border="0" cellpadding="1" cellspacing="1">
<!--DWLayoutTable-->
<tr>
<td width="163" height="21" valign="top" bgcolor="#CCCCCC"><div align="center">Name</div></td>
<td width="199" valign="top" bgcolor="#CCCCCC"><div align="center">Date of registration </div></td>
<td width="178" valign="top" bgcolor="#CCCCCC"> <div align="center">Subscription will end in ... </div></td>
<td width="294" valign="top" bgcolor="#CCCCCC"><div align="center">Series status </div></td>
</tr>';
if(!$db->query("SELECT * FROM `user` , `days_subcription` WHERE user.id = days_subcription.category")){
die($db->error());
}
$a = '';
while($row = $db->fetchAssoc()){
if ($row['name'] != $a){
$a = $row['name'];
print ' <tr>
<td height="21" valign="top" bgcolor="#F5F5F5">'.$row['name'].'</td>
<td valign="top" bgcolor="#F5F5F5">'.$row['date_register'].'</td>
<td valign="top" bgcolor="#F5F5F5">day</td>
<td valign="top" bgcolor="#F5F5F5">';
}
if($row['status'] == '0'){
$col = 'red';
}else{
$col = 'green';
}
print '<img src="img.php?strlen='.strlen($row['day']).'&text='.$row['day'].'&color='.$col.'">'.' ';
}
print '</table>';
?>
Что выходит? (pic1)
В принципе все верно... только сортировка в результате должна быть DESC, т.е самый новый вверху и должна учитываться последовательнасть 3, 7, 12 ...
Подскажите как решить