I was wondering if instead of manually add the news to the forums and my front page, is there a way that if theres a new post in the news category it will automatically add it to my page? (If I worded that right.....)
I was wondering if instead of manually add the news to the forums and my front page, is there a way that if theres a new post in the news category it will automatically add it to my page? (If I worded that right.....)
Last edited by Nailgunpro; 03-01-2008 at 01:32 AM. Reason: mistake
It depends on how they are stored, but a simple example would be this:
Of course, you would want to change according to your situation.Code:<?php include('dbconnect.php'); //all your db info $query = mysql_query("SELECT * FROM `newstable` ORDER BY `postDate` DESC"); $news = mysql_fetch_array($query); //get latest post in news table echo $news['newsTXT']; //display news on page ?>
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Man, I seriously need to learn php.
Im sorry, but will you rewrite that code being very specific on what should I input where?
Again, sorry.
And thanks.
Well, again, depending on your situation/set up, I could rewrite the code in my free time (as can some of the other members here). If you want to learn php, you can visit some tutorial websites like http://www.php-mysql-tutorial.com or the official site http://www.php.net.
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
OK ty I just spent like 2 hours learning some of php enough to understand it, but not write that much. Will you just tell me from that code what I need to input?
Bookmarks