mysql - Why shouldn't I use mysql_* functions in PHP? -


what technical reasons why 1 shouldn't use mysql_* functions? (e.g. mysql_query(), mysql_connect() or mysql_real_escape_string())?

why should use else if work on site?

if don't work on site, why errors like warning: mysql_connect(): no such file or directory?

the mysql extension:

  • is not under active development
  • is officially deprecated of php 5.5 (released june 2013).
  • has been removed entirely of php 7.0 (released december 2015)
    • this means of 31 dec 2018 not exist in supported version of php. gets security updates.
  • lacks oo interface
  • doesn't support:
    • non-blocking, asynchronous queries
    • prepared statements or parameterized queries
    • stored procedures
    • multiple statements
    • transactions
    • the "new" password authentication method (on default in mysql 5.6; required in 5.7)
    • all of functionality in mysql 5.1

since deprecated, using makes code less future proof.

lack of support prepared statements particularly important provide clearer, less error prone method of escaping , quoting external data manually escaping separate function call.

see the comparison of sql extensions.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -