Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-13-2012, 08:46 PM   PM User | #1
Lotto320
New Coder

 
Join Date: Dec 2011
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Lotto320 is an unknown quantity at this point
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.
Lotto320 is offline   Reply With Quote
Old 02-13-2012, 08:59 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Need more info.
What is the <img src> thing?
Do you have any scripts you can show us?
mlseim is offline   Reply With Quote
Old 02-14-2012, 03:30 PM   PM User | #3
Lotto320
New Coder

 
Join Date: Dec 2011
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Lotto320 is an unknown quantity at this point
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..
Lotto320 is offline   Reply With Quote
Old 02-14-2012, 07:02 PM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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..
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:15 PM.


Advertisement
Log in to turn off these ads.