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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    displaying a mysql records in marquee

    hi,

    i have one mysql table called employee.its fields are as follows
    id--name
    1--abc
    2---cbv
    3--edr
    .i want to display the all names from db in html marquee.when i try to print all values it prints only last value in marquee.how to do this.any of your help will be appreciated

    thanks
    mrjameer

  • #2
    New Coder
    Join Date
    Mar 2006
    Location
    São Paulo, Brazil
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, man.... this is happenning because, I think, that you're not looping correctly the variable that contains all the lines of your query.

    How are you trying to print all the names of your table?

    With the structure proposed by you and assuming that you already have made a mysql connection, you should try this:

    PHP Code:
    $query "SELECT name  FROM employee ORDER BY name ASC";
    $result mysql_query($query);

    while( 
    $line mysql_fetch_object($result) )
    {
        
    $body .= $line->name", ";
    }

    print 
    "<marquee>"substr($body, -2) ."</marquee>"

    I think this should help you.
    ----
    As coisas mais simples são as mais importantes.
    ---------
    Thompson M1A1: D-Day
    ----------------

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,


    thanks a lot, it worked excellent

    mrjameer


  •  

    Posting Permissions

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