PHP - Marquee
Hi, i have a marquee on my page that is getting its contents from mysql database. It gets all the information, put it in the marquee and it all scrolls, that works fine. The problem is that it take takes all the information and puts it as one line. That is it takes all the records and makes them as one. I want it to seperate them. I think the problem is with my loop. I have tried moving the loop and nothing seems to work. Please help, here is the code that im using
Code: [Select] <marquee behavior="scroll" direction="up" onmouseover="this.stop();" onmouseout="this.start();"> <h1> <?php require_once("connect.php"); $selectsqw = "SELECT name, quantity, price FROM inventory"; $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) { ?> Latest Tenders: <?php echo "".$rowqw['name']." - ".$rowqw['quantity']." - ".$rowqw['price'].""; ?> <?php } } ?> </h1> </marquee> Similar TutorialsHello everybody , i echo into a marquee one variable which is having value (item) of a rss feed which am parsing . The problem is that into the marquee, is echoed finally, just the first item and not all the items of the feed ! So when am parsing a News rss feed, which is having par example 5 news, my marquee is showing just the first of those 5 Why is this happening ? Here is the code i use : The marquee Code: [Select] <marquee behavior="scroll" scrollamount="5"><b><?php echo "<a href=$sigma2>$sealakefa</a></b></marquee> The php/rss part function readRSSFile($filename) { $data = implode('', file($filename)); $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, $data, $values, $tags); xml_parser_free($parser); foreach ($tags as $key => $val) { if ($key == 'item') { $itemRanges = $val; for($i=0; $i<count($itemRanges); $i+=2) { $offset = $itemRanges[$i] + 1; $len = $itemRanges[$i + 1] - $offset; $result[] = combineItem(array_slice($values, $offset, $len)); } } } return $result; } function combineItem($itemValues) { for ($i=0; $i<count($itemValues); $i++) { if(isset($itemValues[$i]['value'])) { $item[$itemValues[$i]['tag']] = $itemValues[$i]['value']; } } return $item; } $latest = readRSSFile("http://www.jamaicaobserver.com/rss/news/"); for($i=0; $i<count($latest); $i++) { $sigma = $latest[$i]['link']; $tauvf = $latest[$i]['title']; } I want all the items of the feed to be shown into my marquee ! How to do that can you help me please ..? What's wrong ? Thanks in advance.. I have the following code, and want to insert php output into a scrolling marguee to show it on web page. Code: [Select] <?php $playlistUrl = 'http://domain.com/playlist.xml'; $xmldata = file_get_contents($playlistUrl); $xml = new SimpleXMLElement($xmldata); foreach( $xml->trackList->track as $track ) { echo $track->title .' - '. $track->annotation .'<br>'; } ?> How to connect php script and javascript together? I checked various javascript scrollers, some of them accepts HTML markup. |