Hi, I have a table with about 10 entries in and i want to display them all in a <marquee> scrolling but when i put them in a while loop then come out on 10 lines rather than one line one after another. Here is the current code: <?php $selectsqw = "SELECT * FROM loads WHERE deliverydate > DATE_ADD(NOW(),INTERVAL -48 HOUR)+0 ORDER BY id DESC LIMIT 0, 5"; $resultqw = mysql_query($selectsqw); $countrowssaqw = mysql_num_rows($resultqw); if ($countrowssaqw > 1) { while ($resqw = mysql_fetch_array($resultqw)) { $resuqw[] = $resqw; } mysql_free_result($resultqw); foreach ($resuqw AS $rowqw) { ?> <marquee><h1>Latest Loads: <?php echo "".$rowqw['collecttown']." - ".$rowqw['delivertown']." - ".$rowqw['loadready'].""; ?> </h1> </marquee> <?php } } ?> Code (markup): Any ideas how i can get them all on one line? Cheers, Adam
Yes, by default, H1 tags insert a line break. Override this by adding the following in your style sheet for a particular class of H1... display: inline;
That still seems to add them on multiple lines and i have changed the <h1> to <b> e.g. Latest Loads: - - 2007-07-12 Latest Loads: - - 2007-07-12 Latest Loads: - - 2007-07-12 Latest Loads: - - 2007-07-12
Well, move the marquee tag outside of your loop? So instead of... <marquee>text 1</marquee> <marquee>text 2</marquee> You have... <marquee>text 1 text2 </marquee>
Try putting the marquee and h1 tags outside foreach loop, like this: <marquee><b>Latest Loads: </b> <?php foreach ($resuqw AS $rowqw) { echo "".$rowqw['collecttown']." - ".$rowqw['delivertown']." - ".$rowqw['loadready'].""; } ?> </h1> </marquee> Bye ---should have typed faster...---