Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post mysql select 3 id

    hi all how r u ?

    i want code : select another 3 id form table mysql ??

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    select another 3 id form table mysql ??
    Please show what you've done so far.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Feb 2010
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts
    i want display 3 image desc only form table


    $sql2 = "select TOP 3 image from tbl_data order by id desc";
    $result2 = mysql_query($sql2);
    while ($display= mysql_fetch_array($result2))
    {
    echo'
    <table border="0" width="95%" id="table1" cellspacing="4" cellpadding="0">
    <tr>
    <td width="174" class=address >'.$display['image'].'</td>
    </tr>
    </table>
    ';
    }


    example:

    Attach Files
    Attached Thumbnails Attached Thumbnails mysql select 3 id-untitled-2.gif  
    Last edited by t6werserv; 04-02-2010 at 06:07 PM.

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Code:
    $sql2 = "SELECT image FROM tbl_data ORDER BY id DESC LIMIT 3";

  • #5
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,246
    Thanks
    12
    Thanked 340 Times in 336 Posts
    Quote Originally Posted by t6werserv View Post
    <td width="174" class=address >'.$display['image'].'</td>
    you are aware that images in HTML are displayed differently?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Posting Permissions

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