Location: PHPKode > projects > Modular Site Manager > htdocs/sotw_man/display.php
<?
$info = array(
"db_host" => "localhost",
"db_user" => "l33ad_vouksh",
"db_pass" => "xf3G63Wt",
"db_name" => "l33ad_vouall",
"db_table" => "site_sotw_comments"
);

$db = mysql_connect($info["db_host"], $info["db_user"], $info["db_pass"]) or die("Couldn't Connect. <br />Error:".mysql_error());
mysql_select_db($info["db_name"]) or die("Could not select the Database!");

$query = "SELECT * FROM site_sotw ORDER BY id DESC LIMIT 1";
$select = mysql_query($query);
while($r = mysql_fetch_array($select)) {
$image=$r['image'];
$sotwid=$r['id'];
$sitename=$r['site'];
$desc=$r['descr'];
$rating=$r['rating'];
$graphics=$r['graphics'];
$content=$r['content']; 
$clicks=$r['clicks'];

$sotwquery = "SELECT * FROM site_sotw_comments WHERE id='$sotwid' ORDER BY id DESC";
$sotwselect = mysql_query($sotwquery) or die("Could not run Query:".mysql_error());
$sotwrows = mysql_num_rows($sotwselect);

echo <<<END
Site Name: <a href="/sotw_man/click.php?id=$sotwid">$sitename</a><br />
Rating: $rating<br />
Graphics: $graphics<br />
Content: $content<br />
<a href="sotw_man/click.php?id=$sotwid"><img src="$image" style="border: none;" alt="$sitename" title="$sitename" /></a><br />
$desc <br />
Clicks: $clicks<br />
<a href="SotWComments/$sotwid"><span style="font-weight: bold;">Comments</span> ($sotwrows)</a>
END;
}
mysql_close($db);
?> 
Return current item: Modular Site Manager