Hallo,
in meiner Tabelle der DB bei den Topics gibt es ein Feld das heißt attached. Dort ist entweder eine 0 drinne oder ein 1.
Wenn dort eine 1 drinne ist, soll es bei der Ausgabe immer ganz oben stehen.
Egal wie das Datum ist, wonach ich sonst sortiere.
Wie kann ich das machen?
Hier meine DB Abfrage:
PHP-Code:
$b_query = mysql_query("SELECT topic_id,
topic_subject,
author,
views,
closed,
attached
FROM board_topic
WHERE board_id = '".mysql_real_escape_string($_GET['board_id'])."'
ORDER BY date, attached DESC
LIMIT $start, $limit") OR die(mysql_error());
while ($b_row = mysql_fetch_array($b_query))
{
Und hier die Ausgabe:
PHP-Code:
if($j%2==0){$bgcolor="efefef";}
else{$bgcolor="fcfcfc";}
echo '<center><table class="board2" width="100%" style="background-color:#'.$bgcolor.';">
<tr>
<td width="55%">';
if($b_row['attached'] == '1')
{
echo '[img]images/position.gif[/img]';
}
if($b_row['closed'] == '1')
{
echo '[img]images/closed.gif[/img]';
}
echo'
<a class="normal" href=index.php?action=board&topic_id='.print_out($b_row['topic_id']).'>'.print_out($b_row['topic_subject']).'</a>
</td>
<td width="10%"><div id="right">'.print_out($b_row['author']).'</div></td>
<td width="10%"><div id="right">'.print_out($anzahl).'</div></td>
<td width="9%"><div id="right">'.print_out($b_row['views']).'</div></td>
<td width="10%"><div id="right">'.print_out($author).'</div></td>
</tr>
</table></center>';
$j++;
}
Danke