Home  >  Article  >  Backend Development  >  Chat room php&mysql (2)_PHP tutorial

Chat room php&mysql (2)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:05:04676browse

//第二页面 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"].")
";
  }
  ?>

    


  

 



  
  
(人)


 


 




www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315748.htmlTechArticle//第二页面 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-cac...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn