Message board Questions Help
First ask a question about garbled,
The [client] Default-character-set=utf8 [mysqld] Default-character-set=utf8 is set in My.ini and the wamp,phpmyadmin is not connected, it is # 2002 that socket error prompt, and then I will my.ini just do the changes to change back, or not connected, (I put the changes should be able to undo it?? Question 1Finally, change localhost to 127.0.0.1 before returning to normal.
question two: After the above Operation
last question
1. conn File
$conn = mysql_connect ("localhost", "root", "") or Die ("Can ' t connect database:". mysql_error ());
if ($conn)
echo "Link succeeded! ";
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 ("Insert failed:". Mysql_error ());
}
?>
Include ("conn.php");
$rowsPerPage = 10;
$row = Mysql_fetch_array (mysql_query ("SELECT count (*) as C from Easy")); Query total number of records ... In this book, I don't understand, I beg to explain.
$rows = $row [' C ']; Get the number of records
/*
$a = "SELECT * from Easy";
$b = mysql_query ($a);
$rows = mysql_num_rows ($b);
Is this okay? What's the difference between this and the top one?
*/
$pages = Ceil ($rows/$rowsPerPage); Count pages