I want to implement communication between users, the idea is to create a message table, and then put the recipient user name, sender user name, message, etc., and then who want to see the message sent to the message table to find the recipient is their own record. Now do send message this together, sent the message I found that the database message table does not have a record, should be not inserted correctly in the table, God help to see where is wrong, I was just contact with PHP, the previous lesson learned things are basic, applied to practice is always a lot of problems.
The relevant code is attached below (where sqltable is the user table, Sqltable2 is the message table, user_name is the user name stored in the user table, S_name is the sender's store in the message table, and R_name is the recipient in the message table)
config.php
message.php
Send a letter to the administrator
message_cl.php
Reply to discussion (solution)
Message_cl.php 37 Lines
mysql_query ($sql) or Die (Mysql_error ());
$s _name=$_session["name"];
$r _names=$_post["R_name"];
$content =$_post["Content"];
Output, see if it's worth a second.
INSERT INTO $sqltable 2 (S_name,r_name,content,add_time,is_open) VALUES (' $s _name ', ' $r _name ', ' $content ', ' $add _ Time ', ' $is _open ')
Use SQL to manipulate the table to see what the result is.
Haha, give me the points, has been Remote Assistance to solve. is the SQL table does not have the Is_open field and PHP to insert the Is_open field value, there is the SQL statement assembly problem