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