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 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    MySQL (all rows) to marquee

    Is there a way to have all of the row "banner" entries to be dumped into a marquee inside <img src="bannerurlhere">?

    Premium members, them with "premium" on "ok" in the table, will only have their banner shown in the marquee.

    I believe this should be done with SELECT * table WHERE premium="ok" but im not sure.

    ANY help appreciated!
    Thanks.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Need more info.
    What is the <img src> thing?
    Do you have any scripts you can show us?

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Code:
    <marquee width="1000px" height="90px" onmouseover="this.setAttribute('scrollamount', 1, 0);" onmouseout="this.setAttribute('scrollamount', 8, 0);" behavior="alternate" scrollamount="6">
    <?php
    if($row['premium'] == 'ok')
    {
        ?>
     
    <img src="<?php echo $row['banner']; ?>">
    
         <?php
    }
    ?>
    </marquee>
    Something like this connected to a database, which the code dumps all the premiums banners to this marquee..

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    The select part isn't going to be a problem ...

    It's the image situation ...
    It sounds like you're talking about scrolling several of them across the marquee.

    <img ..> is only 1 image, so you'll have to put them in row like this:

    <marquee ...>
    <img src= ...>
    <img src=....>
    <img src=...>
    </marquee>

    PHP can loop through the query results and create the <img > list.
    But first, you should test it by "hard coding" it with some images.
    I'm thinking the marquee isn't going to work very good (but I could be wrong).
    Also, it might not work in all browsers ... especially mobile devices.

    Test it with hand-coded images and make it work before using PHP / MySQL.
    The query part is easy.

    EDIT:
    Also, are you images stored in a directory, or are they actually
    stored in MySQL (Binary BLOB)?


    .
    Last edited by mlseim; 02-14-2012 at 07:06 PM.


  •  

    Posting Permissions

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