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
52
Other forums
limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h
Using unserialize()
Hi there.
I have some data in my database that is serialized.
e.g.
a:2:{i:0
Consuming MII WebService in Java WebDynpro
Hello,
We are facing a strange situation...
We define a transaction in MII to
$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown
Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm
Parse error: syntax error, unexpected T_ELSEIF in /home/......html/item.php on l
I do not know what is wrong with this. Hope some one can help. I do nto want to post the entire site
how can i make a .gif images for my site
Dear Friends ,
Pls solve my problem , I am starting making new site but i dont know how can i
Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but
Using Curl_multi for processing multiple URLs
Hi,
I am at a loss as to how to implement this. I would like to be able to automatically assi
Typing math
I've added support for typesetting math using LaTeX on the forums.
Example:
Code: [Select]