Kikkerkont Wrote:Latest posts:
<?php // DBNAME $dbname = ""; // USERNAME $user = ""; // PASSWORD $password = ""; // TABLE_PREFIX $prefix = "mybb_"; // FORUMROOT $root = ""; // Posts To Show $max = 5; // Connect to db $db = mysql_connect("localhost",$user,$password) or die ("Failure!"); mysql_select_db($dbname,$db); // Get Posts $query = mysql_query("SELECT * FROM ".$prefix."posts ORDER BY dateline DESC LIMIT 0,$max"); while($posts = mysql_fetch_array($query)) { $tid = $posts['tid']; $pid = $posts['pid']; $subject = $posts['subject']; $username = $posts['username']; $post .= $username." <a href=\"{$root}showthread.php?tid={$tid}&pid={$pid}#pid={$pid}\">{$subject}</a><br />"; } echo $post; ?>
Yuck, that is outdated too. Why are you connecting to the database again? And this is the exact same one I posted on my first post, but without the connection again, which is still outdated.