//settings $div = "part5"; $head="Жизнь, как сальса: Нью-Йорк, Нью-Йорк"; $forumlink="http://forum.coronel.ru/index.php?showtopic=10"; ?>
@mysql_connect("localhost", "mikrozof_inetman", "hcYUzO1b");
mysql_select_db("mikrozof_ibase");
$SQLText = "select max(id) as id from $div";
$rs = mysql_query($SQLText) or die("Invalid query: " . mysql_error()) ;
mysql_data_seek($rs, 0); //recordset.prior
$DBRow = mysql_fetch_array($rs, MYSQL_BOTH);
$max_id = $DBRow["id"];
$control = $max_id - 5;
$SQLText = "select * from ".$div." where id > $control order by id desc";
$rs = mysql_query($SQLText) or die("Invalid query: " . mysql_error()) ;
while ($DBR = @mysql_fetch_array($rs))
{
print " ".$DBR["date"]."
";
print $DBR["text"];
if ($DBR["comlink"])
{
print "
";
print "comment on this";
}
print "
";
}
?>