Ben Carey
Ben Carey

Reputation: 16958

PHP MySQL Equivalent MsSQL Functions

I am currently working on a project that requires a connection to a MsSQL database. Although I have never used MsSQL, I am a little familiar with how it works and differs from MySQL. However, I am unfamiliar with the integration of PHP and MsSQL. I have written a class for MySQL and am hoping to convert this class to MsSQL. So far all is good, but I have run into 2 functions that are not present in the predefined PHP library. These being:

  1. mysql_real_escape_string
  2. mysql_field_flags

Does anybody know of somewhere that shows how to recreate these equivalent functions for MsSQL?

Upvotes: 0

Views: 209

Answers (2)

Ben Carey
Ben Carey

Reputation: 16958

I have reviewed this further and concluded that I will need to rewrite these functions myself. When I have done, I will post them up here for reference purposes.

UPDATE

More research has shown that the answer supplied by Viswanathan Iyer, is in fact correct. For connecting to a MsSQL database, the most effective and efficient way is to use the PDO library supplied by PHP

Upvotes: 0

Vishwanath Dalvi
Vishwanath Dalvi

Reputation: 36611

The best option would be to use parameterised queries and prepared statements with PDO library.

Upvotes: 1

Related Questions