Results 1 to 6 of 6

Thread: how to display like below from my table?

  1. #1
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question how to display like below from my table?

    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://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  2. #2
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default hi

    this is my SQL QUERY :
    $sql = "SELECT `ID`,`Profile` FROM `sys_friend_list` WHERE `Check`=0";

    so, what is next?
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  3. #3
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default no reply

    any expert here?
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  4. #4
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    may be none understand what i mean
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  5. #5
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    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 Code:
    <?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
    - Josh

  6. #6
    Join Date
    May 2009
    Posts
    62
    Thanks
    19
    Thanked 3 Times in 3 Posts

    Default

    can you explain it better?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •