Quote:
Originally posted by Sharg
Well I think its not a whole script but just a line or two of codes....
Thanks,
Sharg
|
Every program is just a few lines code but it takes time not to write it down but to "code" it and debug it.
Anyway I dont like people leaving unanswered so here you go
-- cut --
<table width="100%" border="0" cellspacing="1" cellpadding="00">
<?php
## Hostname or IP of your server where MYSQL database resides.
$servername='localhost';
## Username and password to log onto your MYSQL database server
$dbusername='aaaa'; //MYSQL username
$dbpassword='pppp'; //MYSQL password
## Name of the MYSQL database that vbulletin data exits.
$dbname='dddd';
## Location of your forum. Dont forget the trailing /
$forumlocation="http://www.yourdomain.com/forum/";
mysql_connect("$servername", "$dbusername", "$dbpassword") or die("Couldnt find MYSQL!");
mysql_select_db("$dbname") or die ("Couldnt find DB!");
$cekilen_mesleki=mysql_query("
select threadid, title, postusername, postuserid, dateline
from thread WHERE
visible= '1' AND forumid='15'
order by dateline DESC LIMIT 10
");
if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;}
$mesleki_number=mysql_numrows($cekilen_mesleki); //number of news fetched
if ($mesleki_number<=0) {echo "<tr><td bgcolor=\"#000000\">No New Threads!</td></tr>";}//no news on database!
else {
$ii=1;
while ($gelen= mysql_fetch_row($cekilen_mesleki))
{
if ($ii % 2) {$tdcolor="#FFFFFF";} else {$tdcolor="#eeeeee";}
echo '<td><td bgcolor="'.$tdcolor.'">'.date("Y-m-d", $gelen[4]).' : <a href="'.$forumlocation.'showthread.php?s=&threadid ='.$gelen[0].'">'.$gelen[1]."</a> - ".$gelen[2]."</td></tr>";
$ii++;
}
} //else kapa parantez
?>
</table>
-- cut --
This is a sample which gets latest 10 threads of a specific forum and list it in a table.
By changing the query you can list/get any result you want..
Enjoy..