The php message board does not display users (this does not know whether there is a pass-through). in my message board, I left a message, but the message recipient did not display it .. I cannot find it --! Please advise ,... Code provisioning (I don't know if this code is used) (my database has no user name, but it is also blank) & nbsp; & lt ;? Php * & nbsp; * Createdon2012-3-23 & nbsp; * Tochange php message board cannot show users
(I don't know whether there is a picture.) I left a message on the message board, but the message was not displayed .. I cannot find it --! Please advise ,... Code serving (I don't know if this code is not) (my database has no user name, and it is also blank)
/*
* Created on 2012-3-23
*
* To change the template for this generated file go
* Window-Preferences-PHPeclipse-PHP-Code Templates
*/
Include_once ("comm. php ");
$ Conn = mysql_connect ("localhost", "root", "123456") or die ("cannot establish a connection! ");
Mysql_select_db ("lyb") or die (mysql_error (). "The database cannot be opened ");
$ Title = $ _ POST ['title'];
$ Type = $ _ POST ['type'];
$ Content = $ _ POST ['content'];
$ Date_time = date ("Y-m-d H: m: s ");
$ Author = $ _ SESSION ['user'];
If ($ content! = "" And $ title! = ""){
$ SQL = "insert into lyb_table (subject, type, content, publish_time, user) values ('$ title',' $ type', '$ content',' $ date_time ', '$ author ')";
Mysql_query ("set names 'gb2312 '");
Mysql_query ($ SQL, $ conn );
Get_show_msg ("lyb. php", "message successful! ");
} Else {
Get_show_msg ("lyb. php", "the message is incorrect. please enter it again! ");
}
Mysql_close ($ conn );
?>
------ Solution --------------------
Session_start () is not enabled; I think the field name you inserted into the database is user, and you Output $ row ['author'];