php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30119 bug in query with mssql an enterprise manager installed
Submitted: 2004-09-16 16:54 UTC Modified: 2004-09-18 01:02 UTC
From: dehrmann at free dot fr Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.3 OS: XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dehrmann at free dot fr
New email:
PHP Version: OS:

 

 [2004-09-16 16:54 UTC] dehrmann at free dot fr
Description:
------------
I have a pc with easy php installed, MSDE (sql server local) and sql server enterprise manager.
I have no problem to connect to my database on another server (2k).
But when i query the database with fields with accent (like ?tat), i have a bug saying that the name of the column ar not correct.

I use the same program on antoher pc that don't have the sql server enteprise manager on it, the same code will work fine !!!!

If you have sql server enteprise manager installed on your web server you have the same pb. I took the NTWDLIB.DLL in all parts of my pc, the bug is the same.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-16 23:11 UTC] fmk@php.net
This is not a problem with PHP. You should escape field names with special characters. MSSQL Server does this by including each field name in [], like this:

select [?tat] from [my table]

 [2004-09-17 09:27 UTC] dehrmann at free dot fr
I know that. I use [] and it still not working.
The problem reside in the conjonction of php, php_mssql.dll ntwdlib.dll and the client utility for mssql server (sql server enterprise manager).
I say that the same program is OK on a station under XP but whitout 'sql server enterprise manager'.
I do the following : i copy the entire config of easyphp from the pc where it work to the another. We can say that the config is the same. It is still not working fine.
I think that the problem is sharing the system with the manager for msql server. This is the only difference between the 2 station's.
 [2004-09-18 01:02 UTC] fmk@php.net
The library (ntwdblib.dll) uses ANSI to OEM convertions. This can be enabled or disable. When it is enabled the library looks at the context of the calling script. If the script is executed from the command line (CLI or CGI) it will use your systems code page and convert all data to and from ANSI. If the script is called from CGI or ASAPI under a web server both client and server will use ANSI and there is no need for convertion.

Disabling the automatic ansi to oem convertion (Client Network Utility) will solve the problem. Just remember to edit your scripts with an ANSI editor).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 08:01:32 2024 UTC