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 Like 52 Dislike
Previous forums Next forums
Other forums

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Ten Operator Syntax
Hi Guys,

I can't figure out why i am getting a parse error with this basic ten op code:

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with

I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to

Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash