Jump to content

News Ticker from database


I-AM-OBODO

Recommended Posts

Hi all. how can I use the results from my database query as a list items for a news ticker?

 

thanks

 

my code:

 

 $stmt = $pdo->query("SELECT *
FROM ca_updates  ORDER BY date
DESC");
while($row = $stmt->fetch
(PDO::FETCH_ASSOC)) {
 echo '<div id="example">';
echo '<ul>';
echo '<li>'; 
    echo "<div class='update-
heading'>";
    echo "<h4><u>" . ucwords
($row['heading']) . "</u></h4>";
    echo "</div>";
    echo "<div class='update-
date'>" . $row['date'] . '</
div>';
    echo "<p class='update-
contents'>" . $row
['contents'] . "</p>";
echo "</li>";
echo "</ul>
echo "</div>
Link to comment
https://forums.phpfreaks.com/topic/295188-news-ticker-from-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.