An error occurred while coding mysql database operations in php.

Source: Internet
Author: User
There are two lines of the same code, from different php files, in the MySql database (UTF-8 format) operation, a line of code is normal, a line of code exception code 1, exception updateordersystem. productSetPName & #39; 333 car & #39; WhereBianhao & #39; XAHNBQ2LC42GJQP-25 & #39; prompt when saving this line of code to notepad: the code to be saved as Unicode is from file. php, File Save format UTF-8, the file is pure php file, no html code, no encoding mysqlphp database unicode

There are two lines of the same code, from different php files, when operating on the MySql database (UTF-8 format), a line of code is normal, a line of code exception

Code 1, exception
Update ordersystem. product Set PName = '2017 Auto' Where Bianhao = 'xahnbq2lc42gjqp-25 ';
When saving this line of code to notepad, the prompt is: you need to save it in Unicode format
Code from file A. php, File Save format UTF-8, the file is pure php file, no html code, no encoding conversion;

Code 2, normal
Update ordersystem. product Set PName = '2017 Auto' Where Bianhao = 'xahnbq2lc42gjqp-25 ';
When saving this line of code to notepad, the prompt is: save it as ANSI format directly
The code is from file B. php, File Save format UTF-8, the file also has html code, and meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/

The two lines of code are different in the last number 'xahnbq2lc42gjqp-25', and the rest is normal.

Problem:
1. Why is the first code in Unicode format?
2. how can I replace the first code with a format that can be accepted by the database?

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.