• 技术文章 >php教程 >php手册

    聊天室php&mysql(二)

    2016-06-21 09:03:25原创358
    //第二页面 name="frame2.php"



    include "../signup/mysql.php";
    header("Expires: Sun, 28 Dec 1997 09:32:45 GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Content-Type: text/html; charset=${Charset}");



    $current_time=time();
    $delete_time=$current_time-40;
    $sql="delete from chat_user where last_time<".$delete_time;
    mysql_query($sql)or die(" false again");



    $sql="update chat_user set last_time='$current_time' where userid='$userid'";
    mysql_query($sql) or die("false");

    $sql="select userid from chat_user";
    $result=mysql_query($sql)or die("fallse");
    $online=mysql_num_rows($result);
    ?>



    user list








    在线人数






    $sql="select userid,id,sex from chat_user";
    $result=mysql_query($sql)or die("fallse");
    while($row=mysql_fetch_array($result)){

    $user=$row['userid'];
    $user="".$row["id"];
    echo $user."
    (".$row["sex"].")
    ";
    }
    ?>





    (人)








    php入门到就业线上直播课:查看学习

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

    千万级数据并发解决方案(理论+实战):点击学习

    Mysql单表千万级数据量的查询优化与性能分析

    Mysql主从原理及其在高并发系统中的应用

    专题推荐:nbsp lt gt userid user
    上一篇:我的论坛源代码(九) 下一篇:自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)

    相关文章推荐

    • ❤️‍🔥共22门课程,总价3725元,会员免费学• ❤️‍🔥接口自动化测试不想写代码?• 我的论坛源代码(五)• 聊天室php&mysql(四)_php基础• PHP 采集程序原理分析篇• mysql 数据备份类代码
    1/1

    PHP中文网