Does the deprecation of mysql_* functions in PHP carry over to other Databases(MSSQL)?

I’m not talking about MySQL, I’m talking about Microsoft SQL Server

I’ve been aware of PDO for quite some time now, standard mysql functions are dangerous and should be avoided.

http://php.net/manual/en/function.mysql-connect.php

But what about the MSSQL function in PHP? They are, for most purposes, identical sets of functions, but the PHP page describing mssql_* carries no warning of deprecation.

http://us.php.net/manual/en/function.mssql-connect.php

There are PDO drivers available for MSSQL, but they aren’t quite as readily available or used as the MySQL drivers.

Ideally, it looks to me like I should get them working and move from mssql_* to PDO like I have with MySQL, but is it as big of a priority?

Is there some hidden safety to MSSQL that means it’s exempt from all of the mysql_* hatred as of late? Or is its obscurity as a backend the only reason there hasn’t been more PDO encouragement?

2

The MSSQL_* and MySQL_* families of functions share a common interface (i.e. similar naming), for convenience (if you know one’s functions, then you know the other’s) but that’s where the similarities stop.

And… there’s no hatred for the MySQL_* family, it’s not “dangerous”, its use is discouraged as it’s using an older MySQL API that’s no longer relevant (except for legacy applications). Right now (PHP 5.4) MySQL_* isn’t actually deprecated, using its functions doesn’t even raise an E_DEPRECATED error, but the extension is not actively developed, only maintained (bug fixes only, and even them are not high priority). We don’t know when the functions will be actually deprecated, but the usual process is that in a future version using them will raise an E_DEPRECATED error, and at an even later version the extension will not be available as part of the default installation and will no longer be maintained.

I don’t know what you mean when you say that MSSQL drivers aren’t readily available, but PHP no longer bundles MySQL client libraries since the first iteration of PHP 5.0. Client libraries are essential for any database, as PHP’s extensions are for the most part just wrappers of the client libraries. You’ll have to install the client libraries yourself for both MySQL and MSSSQL, and perhaps you haven’t noticed that yet because you are using a LAMP or WAMP bundle that installs everything for you. Still, in a vanilla setup the database’s client libraries must be installed separately.

PDO offers a mostly database agnostic interface, however it’s completely up to you whether you are going to use it or use MSSQL_*. If you are working with different databases, not necessarily in the same project, PDO might be the better choice as you’d have to familiarize yourself with one interface. And if your project uses multiple database then PDO is the clear winner. Personally I’ve moved on to PDO for all my database needs, and never looked back.

To summarize:

  • MSSQL_* and MySQL_* share a common interface for convenience, nothing more, they are just wrappers to their respective database client libraries.
  • MySQL_* soon won’t be available, but MSSQL_* will.
  • Both PDO and MSSQL_* are valid choices for working with SQL Server.

6

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật