Log in

View Full Version : Sort of iframing content on forum page to other page



Nailgunpro
03-01-2008, 01:32 AM
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.....)

thetestingsite
03-01-2008, 01:39 AM
It depends on how they are stored, but a simple example would be this:



<?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
?>


Of course, you would want to change according to your situation.
Hope this helps.

Nailgunpro
03-01-2008, 01:50 AM
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.

thetestingsite
03-01-2008, 02:36 AM
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.

Nailgunpro
03-01-2008, 03:30 AM
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?