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
Mail functionality from localhost to server
Hi
I am facing problem of mail functionality.
When i tested mail functionality in my
Undefined Variable: PHP_SELF, pls help
Hi,
Im a newbie on PHP / MySQL programming and Im running a script to search one field on my
PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.
How would I exac
Can we convert non uni code system into unicode
Hi All,
Presently i am using non-unicode system and the sap version is 4.7.
Can i c
Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now
Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing
Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into
Database connection failure
Hello All,
I am trying to create new connection to Oracle DB 10.1,
I could not see a
WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.
form variables from database help.
Hi all,
I would like to have a form that gives you options based on the results of an mysql q