hey guys
gonna give a brief rundown of what im trying to do. Basically, im using a software for tv screens that can point to any rss file and will display the rss on tv screens as a "ticker" very similar to cnn. What I am trying to achieve is through my website, have someone who has these screens in their facility log in, be able to update this "ticker" file, and have the software that is pointing to this file read and display the new ticker.
im new to php but I already have it set up so that users can log in, and update the ticker in mysql..now I need to somehow convert this to rss...I have been browsing on the web and a snipet of coding that I found to have worked is below...I tried pointing the software at the file for it and appeared to work...it is as follows
<rss version="2.0">
<channel>
<title>Test Title</title>
<description>This is an example description</description>
<link>http://pixel2life.com</link>
<?
$sql = "SELECT * FROM news limit 5";
// $sql = "SELECT ticker FROM host_locations WHERE location_id='$location_id' "; This is the query that I tried adding since im trying to select the ticker from host_locations and make sure that it is the right one by using WHERE location_id='$location_id'";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
?>
<item>
<title><?=$row['title']; ?></title>
<author><?=$row['author']; ?></author>
<link>http://MYSITE.com/news.php?id=<?=$row['id']; ?></link>
</item>
<?
}
?>
</channel>
</rss>
the script that I initialyl took this from in the db had 4 fields - id, title, author, content
now I already have a "ticker" row in my table host_locations and really, I dont think I need the other stuff because I already have the stuff I need in my host_location table (id) anyway...I dont need to have author, content, title etc. used really I just need to have content used so it just displays the text thats in the ticker row. Everything ive tried isnt working and even using the code from the initial script I had it working, howver it displays it in rows etc just like a rss file...is there a way so it doesnt display it like this??? All I want to be shown is the text...I have it within a tv image scrolling in a marquee so it resembles what it would look like. Any help would be greatly appreciated