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.
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
Update data to upper case in parent/child tables
Hi Gurus!
In production we have a product table and which is being reference by many tabl
Uploading Filetypes and placing them in seperate folders.
Hello,
first post , and asking for help im afraid. Very new to PHP, was making good progress
FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image
PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the
displaying email without attracting a ton of spam
Hello,
this is maybe the wrong place to ask.
How would you display an email address on a w
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d
EXplanation help
Hey all,
I am still fairly new to PHP programming and I am trying to put together a page wher
All possible combinations of String in PL/SQL
Hi All,
Could you please explain the logic of getting all possible combinations of String
How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul
my two tables
table1 : col1 = topicid , col2 = topic
table2 : col1 = sentid, col2 = sentence
Cod