当前位置:Gxlcms > PHP教程 > 采用行写方式的聊天程序(之四)_PHP教程

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

时间:2021-07-01 10:21:17 帮助过:19人阅读

(接前面部分)










lt3.php(做为现在的主流开发语言)
处理发言信息

session_start();
include("g_fun.php(做为现在的主流开发语言)");
f_connectdb();

$query = "select max(lt_id) as rmaxid from lt_t_content";
$res = MySQL(和PHP搭配之最佳组合)_query($query, $dbh);
$row = MySQL(和PHP搭配之最佳组合)_fetch_array($res);
$maxid = $row["rmaxid"];
if (empty($maxid)) { $maxid = 0; }
$maxid = $maxid + 1;
//增加聊天信息
$query = "insert into lt_t_content(lt_id,lt_speaker,lt_speaked,lt_secrecy,lt_content,lt_time,lt_face)";
$query .= " values(".$maxid.",".$username.",".$towho.",1,".$oldsays.",now(),1)";
$res = MySQL(和PHP搭配之最佳组合)_query($query, $dbh);

//修改最后聊天时间,判断用户是否存在,防止超时被删除
$query = "select count(*) as rcount from lt_t_online where lt_username = ".$username."";
$res = MySQL(和PHP搭配之最佳组合)_query($query, $dbh);
$row = MySQL(和PHP搭配之最佳组合)_fetch_array($res);
$lcount = $row["rcount"];
if ($lcount == 0) {

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/509055.htmlTechArticle(接前面部分) body leftmargin="0" topmargin="0" div align=center br form method="post" action="lt3.php (做为现在的主流开发语言) " name="fyq"target="bforlt3" onsub...

人气教程排行