I-AM-OBODO Posted March 9, 2015 Share Posted March 9, 2015 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 More sharing options...
Barand Posted March 9, 2015 Share Posted March 9, 2015 http://lmgtfy.com/?q=news+ticker+for+website Link to comment https://forums.phpfreaks.com/topic/295188-news-ticker-from-database/#findComment-1507931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.