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.
php mysql script to find record
Hi, Currently I have a simple table with 4 columns. A, B, C, D If I want to find all the records with the similar value in column B. How can i write a simple query to match this one ? Please advise.
IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?I know that maybe it is not as secure, but I would prefer them to be logged into a text file for simplicity's sake.THANKS!The php script is
for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain data.Please have a look.Code: function add_user_to_db() {
Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built into it. Trying to figure out the best way to make the drawings work. I'm still new to cron jobs but
show random images
hey guyscan someone please suggest a way in which the following code can be edited so it only picks up .jpg files, and so it only shows 20 of them which where found, in a randomized orderCode:
! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement to NOT TRUE and skips onto the next 'IF' satement whereas I would have thought that it would have
Parse multirow HTML table
Hello all, I have a site I am working on. Its a sports site and I am trying to add stats to a DB. I have a table that will have varying amounts of rows depending on how many kids are on the team. I
Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.The problem I have, is getting php to access the php session. It gives me a persmission error. It seems the
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 make a .gif images for my site . Is there any editor to make my .gif images comfortably
Creating an invoice
Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tiers.I've got it working so it only displays a tier if the quantity is greater than 0 but I end up