. "> "> 说 . 说话 悄悄">
当前位置:Gxlcms > PHP教程 > 聊天室php&mysql(三)

聊天室php&mysql(三)

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

第三个页面 name="frame3.php"


include "../signup/MySQL(和PHP搭配之最佳组合).php";
//echo $userid;
//echo $private;
if($p)$p=1;
else $p=0;

if(($action="ok")and($p)){

$sql="select userid,id from chat_user_list where userid='$userid'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql);
$roww=MySQL(和PHP搭配之最佳组合)_fetch_array($result);
$userrr=$roww["id"];





$sql="select userid,id from chat_user_list where id='$object'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql);
if($row1=MySQL(和PHP搭配之最佳组合)_fetch_array($result))
$object=$row1["userid"];
else {
  $object="大家";
  $k=1;}   

$select="select row from user_message order by row DESC";
    $result=MySQL(和PHP搭配之最佳组合)_query($select)or die(" false fgfg");
    $rowlist=MySQL(和PHP搭配之最佳组合)_fetch_array($result)or die("false fgs");
    $max_row=$rowlist["row"];

$row=$max_row+1;
$time1=date("G:i");


$sql="INSERT INTO user_message (userid,object,message,status,action1,color,row,time1) values('$userid','$object','$message','$private','$action1','$color','$row','$time1')";

MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());

if($k){$object="大家"; $private=0;}
else
$object=$row1["id"];
}

?>


input table









 
 

  

. 
   
   
   说 
   
   
   
  


  

. 
   

忘记密码?

登录