20,358
社区成员
发帖
与我相关
我的任务
分享
$sql="select * from table where id='1' ";
$num = mysql_num_rows(_query($sql));
while (true){
// $num2 = mysql_num_rows(_query($sql));
//这个地方怎么写啊*******
sleep(1)
//若得到数据则马上返回数据给客服端,并结束本次请求
if(数据库有新记录){
alert('有新记录');
exit();
}
//服务器($_POST['time']*0.5)秒后告诉客服端无数据
if(没有新记录){
alert('没有更新记录');
exit();
}
}