<?php
$dblink = mysql_connect('localhost', 'root', '');
mysql_select_db('pts_root');
if($_GET['lastid']){
	$query = 'SELECT * FROM makhtab WHERE code < "'.$_GET['lastid'].'" ORDER BY code DESC LIMIT 0, 30';
	$result = mysql_query($query);
	while($rec = mysql_fetch_object($result)) {
		echo '<div class="postitem" id="'.$rec->code.'">Post no '.$rec->code.': '.$rec->name.'"</div>';
	}
}
?>
