Php SQL server operation error solution

Source: Internet
Author: User
SQL statement: insertintosomeTablevalues ('20170101', '20160301', '20160301', '20160301', '20160301', 4, '20160301 ', 'panicline', '01', '0. 125 GB * php SQL server operation error
Php operations on SQL server 2000
The SQL statement is:
Insert into someTable values ('20160301', '20160301', '20160301', '20160301', 4, '20160301', 'cyclicline', '01', '0. 125 Gbit/s * 20', 'oral frequently-release dosage form ', 16,1, 16,0, 0, '0', '1', '2017-05-07', 'Up ', '11', 'box', 16, 0, 0, 0, '01', '01', 16, 0, 0, 'zl001', '2017-5-7 ','/', '/','/')
The SQL query analyzer in SQL sever2000 is executed successfully, but an error is reported in php. the code is as follows:
PHP code
  
  
  


The following error is reported:
Link db success!
Warning: mssql_query () [function. mssql-query]: message: row 1st: Syntax error near '01. (Severity 15) in C: \ AppServ \ www \ test \ insert. php on line 14

Warning: mssql_query () [function. mssql-query]: message: String ')' contains unclosed quotation marks. (Severity 15) in C: \ AppServ \ www \ test \ insert. php on line 14

Warning: mssql_query () [function. mssql-query]: Query failed in C: \ AppServ \ www \ test \ insert. php on line 14
Unable to execute SQL: insert into someTable values ('20160301', '20160301', '20160301', '20160301', '20160301', '201601 ', '0. 125 Gbit/s * 20', 'oral frequently-release dosage form ', 16,1, 16,0, 0, '0', '1', '2017-05-07', 'Up ', '11', 'box', 16, 0, 0, 0, '01', '01', 16, 0, 0, 'zl001', '2017-5-7 ','/', '/','/')

Where is the problem? The SQL statement should be okay. why is an error reported? Thank you!

------ Solution --------------------
It may be a problem with escape characters.

'/-'-> '//', Try
------ Solution --------------------
Charset = utf-8 ???

SQL server 2000 does not support UTF-8 encoding
The special character "'" must be converted to "''"
------ Solution --------------------
SQL Server 2000 does not store data in the form of UTF-8, only supports UTF-8 in one critical scenario, that is, supports Extensible Markup Language (XML ), therefore, the SQL Server 2000 database does not support UTF-8 directly.

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.