作者:手浪用户2602890763 | 来源:互联网 | 2023-09-17 23:56
//第一个页面 name=”index1.php”
include “../signup/mysql.php”;
http://www.gaodaima.com/47242.html聊天室php&mysql(一)_php
$time1=time();
//$userid=983530409;
echo $n;
if($n==1){
$userid=time();
$nick=”g”.$userid;
$last_time=$userid;
$sql=”insert into chat_user (userid,id,last_time) values (‘$userid’,’$nick’,’$last_time’)”;
mysql_query($sql)or die(mysql_error());
$sql=”insert into chat_user_list (userid,id,last_time) values (‘$userid’,’$nick’,’$last_time’)”;
mysql_query($sql)or die(mysql_error());
echo”LOADING ……..”;
echo “”;
}
if($n==983530409)
{
$sql=”select userid,sex,passwd from user where id=’$n'”;
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$nick=$row[“userid”];
$passwd=$row[“passwd”];
$sex=$row[“sex”];
$sql=”insert into chat_user (userid,passwd,sex,last_time,id)values(‘$n’,’$passwd’,’$sex’,’$time1′,’$nick’)”;
mysql_query($sql)or die(mysql_error());
echo”LOADING ……..”;
echo “”;
}
?>
欢迎大家阅读《聊天室php&mysql(一)_php》,跪求各位点评,若觉得好的话请收藏本文,by