session_start();
set_time_limit(60);
$lastID = 0;
if (session_is_registered('last_select_id'))
{
$lastID =(int)$_SESSION['last_select_id'];
}
else
{
session_register('last_select_id');
$_SESSION['last_select_id'] = $lastID;
}
$dbResult = mysql_query("SELECT * FROM test WHERE id>{$lastID} ORDER BY id");
if ($dbResult)
{
while (($row = mysql_fetch_row($dbResult)) !== false)
{
$_SESSION['last_select_id'] = $row['id'];
}
}
session_unregister('last_select_id');
I can only by what you tell me, although I feel that it should be throttled initially , and not just wait for PHP to spit out a timeout.
EDIT , , ALTER "" , .
EDIT2 , . / . , , ($ lastID , 1 ).