Chatting room php & mysql (III)

Source: Internet
Author: User
Nameframe3.php & lt ;? Include .. signupMySQL (the best combination with PHP ). php; echo & #36; userid; echo & #36; private; if (& #36; p) & #36; p1; else & #36; p0; if (& #36; actionok) and (& # third page name = "frame3.php"


Include "../signup/MySQL (the best combination with 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 (the best combination with PHP) _ query ($ SQL );
$ Roww = MySQL (the best combination with PHP) _ fetch_array ($ result );
$ Userrr = $ roww ["id"];





$ SQL = "select userid, id from chat_user_list where id = '$ object '";
$ Result = MySQL (the best combination with PHP) _ query ($ SQL );
If ($ row1 = MySQL (the best combination with PHP) _ fetch_array ($ result ))
$ Object = $ row1 ["userid"];
Else {
$ Object = "everyone ";
$ K = 1 ;}

$ Select = "select row from user_message order by row DESC ";
$ Result = MySQL (the best combination with PHP) _ query ($ select) or die ("false FGG ");
$ Rowlist = MySQL (the best combination with 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 (the best combination with PHP) _ query ($ SQL) or die (MySQL (the best combination with PHP) _ 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.