0

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?

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer, I have now had a chance to research into PDO a little more and it is definitely the way to go. Thank you!
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.