Questions about Message Board

Source: Internet
Author: User
For more information about the message board, see my. & nbsp; [client] & nbsp; default-character-set = utf8 & nbsp; [mysqld] & nbsp; & nbsp; default-character-set = utf8 & nbsp message board for help
First, ask a question about garbled characters,
In my. [client] default-character-set = utf8 [mysqld] default-character-set = utf8 is set in ini, and wamp is restarted. phpmyadmin cannot be connected, is #2002 that Socket Error prompt, then I will put my. the ini modification was changed back, or the connection failed. (can I cancel the modification ?? Problem 1) change localhost to 127.0.0.1 to restore normal
Question 2: After the above operations


Last question


1. conn file
 $ Conn = mysql_connect ("localhost", "root", "") or die ("Can't connect database:". mysql_error ());
If ($ conn)
Echo "link successful! ";
Mysql_select_db ("liuyan ");
Mysql_query ("set names 'gbk '");
?>


2. input file
 


3. write file
 Include ("conn. php ");
If (isset ($ _ POST ['username']) {
$ Username = $ _ POST ['username'];
$ Title = $ _ POST ['title'];
$ Content = $ _ POST ['content'];
$ SQL = "insert into easy values ('$ username',' $ title', '$ content', now ())";
Mysql_query ($ SQL) or die ("insertion failed:". mysql_error ());
}
?>
Include ("conn. php ");
$ RowsPerPage = 10;
$ Row = mysql_fetch_array (mysql_query ("select count (*) as c from easy"); // query the total number of records...
$ Rows = $ row ['c']; // Obtain the number of records.

/*
$ A = "select * from easy ";
$ B = mysql_query ($ );
$ Rows = mysql_num_rows ($ B );
Is that okay? What is the difference between this and above ??
*/

$ Pages = ceil ($ rows/$ rowsPerPage); // calculate the page number
Related Article

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.