Log in

View Full Version : how to display like below from my table?



smansakra
08-15-2009, 08:35 AM
i want to display ID and Profile that Check = 0

and i want the result is like this 2,16,26

how to do that? thanks

below is my table image
http://img44.imageshack.us/img44/4798/tableant.jpg

smansakra
08-15-2009, 10:10 AM
this is my SQL QUERY :
$sql = "SELECT `ID`,`Profile` FROM `sys_friend_list` WHERE `Check`=0";

so, what is next?

smansakra
08-16-2009, 03:10 AM
any expert here?

smansakra
08-16-2009, 04:38 AM
may be none understand what i mean

JShor
08-16-2009, 10:06 PM
Sorry, you need to explain better. Are you trying to sort everything in numerical order and have it displayed?

If so, this code should vork:


<?php

$sql = "SELECT `ID`,`Profile` FROM `sys_friend_list` WHERE `Check`=0 ORDER BY Profile ASC"; // ASC for ascending order, DESC for descending

$qq = mysql_query($sql) or die(mysql_error());

echo '
<table align="center">
<tr>
<th>ID</th>
<th>Profile</th>
<th>Check</th>
<th>When</th>
</tr>
';

while($row = mysql_fetch_array( $qq )) {

echo '
<tr bgcolor="#E8E8E8">
<td><b>'.$row[ID].'</b></td>
<td><b>'.$row[Profile].'</b></td>
<td><b>'.$row[Check].'</b></td>
<td><b>'.$row[When].'</b></td>
</tr>
';

}

?>


HTH:)

heavensgate15
08-17-2009, 06:32 AM
can you explain it better?