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
pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that
Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with
How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But
Oracle Connectivity
Hi Every One,
Can we access SAP from oracle database.If it possible then please spec
limit string by words??
hello all,
I was wonder if there is a function to limit a string by the number of words inste
using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s
How to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a
Which PHP-Editor do you think is the best?
Hi everyone,
Myself Brian Anderson. For the last 2 years i have been working a
Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I