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
http to https
Hi,
Is there any specific method/condition to move an http:// page to https:// ?
Problem in OnClientClick and OnClick sync
Hi,Strange and irritating problem:
I have below button declaration in markup of the aspx page:
How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse
Estimations and Effort
HI Gurus,
Would like to know whether SAP have a provision for carrying out the Project es
Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration se
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an
How to schedule the a job?
Hi,
I have prepared a task ( i.e. a procedure is prepare the file and send the same to con
(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,
We have previously extended the size of the custom data tab on PO transaction ME23
Website Direction...
I recently used this code to try and make it so the page loads as http://www.domain.com/ when you ty
CURL XML Request [From C to PHP]
Hi,
I need some help converting this into something that will work with PHP.
Code: #