الطريقة إذا كالتالي :
كود:
<?php
// The number of posts you want to see
$count = 5;
// url to the forum
$forum_url = 'http://forum.arabbuilder.com/';
// The dbase information
$dbserver = 'localhost'; // The server name ( hostname )
$dbuser = 'username'; // The username
$dbpass = 'password'; // The password
$dbname = 'dbname'; // The database name
$db_conn = mysql_connect( $dbserver, $dbuser, $dbpass );
$result = mysql_db_query($dbname, "SELECT thread.threadid AS id,thread.title AS title,thread.replycount AS replycount,thread.forumid AS forumid,forum.title AS forumtitle FROM thread,forum WHERE forum.forumid = thread.forumid ORDER BY thread.lastpost DESC LIMIT $count" , $db_conn);
while ($thread = mysql_fetch_array( $result )) {
$text = $thread["title"] . " : " . $thread["threadindex"];
$text = strip_tags(substr( $text, 0, 51 ));
echo $text . " <a href='".$forum_url."showthread.php?threadid=".$thread["id"]."'>التفاصيل</a><br>";
}
mysql_close( $db_conn );
?>