About MySQL data save with UTF8 encoding saved, some data search not to

Source: Internet
Author: User
My Web page is UTF8 encoded, so I added mysql_query ("Set names ' Utf-8 '") when I saved the data;

MySQL organized into a utf8_general_ci

While I was searching for data,
$so = "Love You 10,000 Years";
Movie ' WHERE ' a0 ' like '% $so% ' and ' A2 ' like '% $so% ' LIMIT 0, 1200


In this way, when searching for Chinese variables, some of the variables passed in Chinese are not searched at all.


Reply to discussion (solution)

$so Use single quotes do not parse variables because of this?

Did the search add set names UTF8?

$so Use single quotes do not parse variables because of this?
This should be a positive solution.

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