Scrolling news bar and MySQL
Posted on
16th Feb 2014 07:03 pm by
admin
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty new to PHP. I am editing a website for a friend. He had a news headlines section on his home page, but wants to change it to a news bar that scrolls through the most recent news on their database. I have been searching for help online for this and have felt like I was close, but never quite found what I needed (especially since I am new to this).
I found this tutorial (http://www.dynamicdrive.com/dynamicindex2/crosstick.htm), which is what I want... except that I don't want to use an Array for the headlines, but I want it to pull from my database. Is there an easy way for me to do this? I already have a php file from the previous news headlines section, but am not sure how to get that to work with this new code.
Did you know?Explore Trending and Topic pages for more stories like this.
Here is the code for the previous headlines...
Code: [Select]<div id="news">
<?php
getHeadlines();
/*
include("admin/nCMS/nSQL.php");
$db = new nSQL("local");
$q = "SELECT nDate, nTitle FROM `gtt_news` ORDER BY nDate DESC LIMIT 5;"
$r = $db->select($q);
while($data = $db->get_row()) {
echo "<div class="newsitem">";
echo "<p class="text"><a href="#">.$data['nTitle'].</a></p>";
echo "</div>";
}
*/
?>
</div>
Please let me know if any other code is needed.
Thanks so much for your help.
No comments posted yet
Your Answer:
Login to answer
86
52
Other forums
Delete records not in top 15
Hi,
I'm creating a hall of fame page in my game and the page will only display the top 15 sco
Varible in trigger - refering to correct schema
Hello
Im having some issues with my trigger.
What I want to do is call opon a differ
php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecu
isset undefined variable
Hi all,
Hope someone can point out the obvious. I've a log in script, if you dont enter a use
Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co
Redirect not working after making a POST/GET
Hi Everyone,
I am a novice in PHP. Here I have 2 pages, one page with a textbox and button an
Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an
Query issues
I probably have this setup wrong well I know I do because nothing is showing up now. What I want is
How to display value in drop down list after form has been reloaded
Please bear with me as I am very new to php and html.
I have a form with several drop down me
Login Functionality Working Different on IE
This is an odd one, I have a site which has an admin section. The admin pages unsurprisingly require