PHP fetch MySQL, after uploading to the server, display Chinese as garbled

Source: Internet
Author: User
Keywords Php
Php

Data table is UTF8_GENERAL_CI encoded, field value
首页å½å¹...å¹»ç¯ç‰‡
The corresponding is
Home Wide Slide

 
   
   ...//mysql_query( "SET NAMES UTF8" );$result = mysql_query( "SELECT name FROM info_category LIMIT 1" );if ( $result ){    while( $row = mysql_fetch_array($result) )    {        echo "
". $row['name']; }}

I installed XAMPP on the development machine and the debug display was correct. Uploaded to the server to run, the Chinese from the database is displayed as garbled.

The same test code file, the results are different, how to do?

I checked the database code, tried set names, not on the server. The server operating system is Linux, the development machine is windows, and the operating system doesn't matter.

  • 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.