PHP Connection mssql Some questions, sincerely ask for answers

Source: Internet
Author: User
PHP MS SQL Database

A small application in a project, because I only point PHP, so I wrote a script in PHP
Now encountered the problem is this, I operate the database is MSSQL inside the table name and fields are Chinese I a connection on the error
I know the problem is on the character set. Presumably everyone has encountered such a problem, how do you solve it?
mssql_select_db ("Wzck", $con);
$result = Mssql_query ("SELECT * from warehouse data table WHERE id= ' $bh '");


Reply to discussion (solution)

Do not know why to use Chinese name, change into English bar.

Table names and field names that do not follow the variable expression naming rules need to be escaped
The name of the MSSQL escape character is []
The name escape character for MySQL is '

Also pay attention to the problem of GBK and UTF8 coding.

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