Php simple message board program code. This is the most basic message board program, but it has basic functions and is suitable for beginners of php, of course, it can also be used for enterprise websites. this is also the most basic message board program. However, with the basic functions of the message board program, it is suitable for beginners of php, of course, it can also be used for enterprise websites.
| The code is as follows: |
|
|
Session_start ();
$ Con = mysql_connect ('localhost', 'root', 'root') or die ('database connection failed! ');
Mysql_query ('set names utf8 ');
Mysql_select_db ('guestbook ');
$ Pagesize = 10; // The number of message records displayed on each page
If (isset ($ _ GET ['Page']) & $ _ GET ['Page']! = '') $ Page = $ _ GET ['Page'];
Else $ page = 0;
$ SQL = "SELECT a. *, B. name, B. email, B. qq, c. revert_time, c. revert
FROM post
Left join revert c ON (a. id = c. post_id), guest B
WHERE a. guest_id = B. id
Order by a. id DESC ";
$ NumRecord = mysql_num_rows (mysql_query ($ SQL ));
$ Totalpage = ceil ($ numRecord/$ pagesize );
$ RecordSql = $ SQL. "LIMIT". $ page * $ pagesize. ",". $ pagesize;
$ Result = mysql_query ($ recordSql );
?>
PHPiask simple message board
|