Questions about the message board

Source: Internet
Author: User
Tags socket error
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
  • 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.