Heim  >  Artikel  >  Backend-Entwicklung  >  采用行写方式的聊天程序(之五)_PHP教程

采用行写方式的聊天程序(之五)_PHP教程

WBOY
WBOYOriginal
2016-07-13 17:22:00734Durchsuche

lt4.php
处理定时刷新问题

session_start();
include("g_fun.php");
f_connectdb();
$tmpi = 0;
$query = "select lt_id,lt_speaker,lt_face,lt_speaked,lt_time,lt_content from lt_t_content";
$query .= " where lt_id > ".$chat_hh. " order by lt_time ";
$res = mysql_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
?>


$tempi=$row[lt_id];
}
if ($tempi > $chat_hh) {
$chat_hh = $tempi;
}
?>


ltonline.php
处理在线用户信息

include("g_fun.php");
f_connectdb();
//删除长时间没有发言的用户信息
$query = "update lt_t_online set lt_state = 1 where (now() - lt_lasttime) > 500";
$res = mysql_query($query, $dbh);
print " 在线人员信息
";
$query = "select lt_username from lt_t_online where lt_state = 0";
$res = mysql_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
print $row["lt_username"].
;
}
?>

【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/532367.htmlTechArticlelt4.php 处理定时刷新问题 session_start(); include(g_fun.php); f_connectdb(); $tmpi = 0; $query = select lt_id,lt_speaker,lt_face,lt_speaked,lt_time,lt_content from lt_t_con...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn