Chatting room php & mysql (III)

Source: Internet
Author: User
Third page name & quot; frame3.php & quot; & lt ;? Include & quot ;.. signupMySQL. php & quot; echo $ userid; echo $ PRivate; if ($ p) $ p1; else $ p0; if ($ action & quot; OK & quot ;) and third page name = "frame3.php"


Include "../signup/MySQL. 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_query ($ SQL );
$ Roww = mysql_fetch_array ($ result );
$ Userrr = $ roww ["id"];





$ SQL = "select userid, id from chat_user_list where id = '$ object '";
$ Result = mysql_query ($ SQL );
If ($ row1 = mysql_fetch_array ($ result ))
$ Object = $ row1 ["userid"];
Else {
$ Object = "everyone ";
$ K = 1 ;}

$ Select = "select row from user_message order by row DESC ";
$ Result = mysql_query ($ select) or die ("false FGG ");
$ Rowlist = mysql_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_query ($ SQL) or die (mysql_error ());

If ($ k) {$ object = "everyone"; $ private = 0 ;}
Else
$ Object = $ row1 ["id"];
}

?>


Input table



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.