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
returning data from an ssh2_exec()
here's what i got.
$conn = ssh2_connect($this->_host);
ssh2_auth_password($c
Display data returned from Ajaxservices!!
I have a question about displaying results using ajax. I have part of the code below.
$.ajax({
How to find OS bit version
How can I tell the person browsing my site is running 32, or 64 bit operating system?
How can I get my program to read a larger array ??
Hi:
I have this program that reads from an array to do calculations. The array are just t
extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only
Not showing whole name with mail () script
I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with
Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so
Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne
Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a sma
post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu