Why is not preferable to use mysql_* functions in PHP?

0 votes
Can someone tell me the reasons because of which why one should not use mysql_*functions like(mysql_query(), mysql_connect() or mysql_real_escape_string())?
Sep 7, 2018 in Database by CodingByHeart77
• 3,690 points
60 views

1 answer to this question.

0 votes

The reasons are as follows:

The MySQL extension:

  • Does not come under active development
  • Is officially deprecated as of PHP 5.5 (released June 2013).
  • Has been removed entirely as of PHP 7.0 (released December 2015)
  • It lacks an OO interface
  • Also does not  support:
    • Non-blocking, asynchronous queries
    • Prepared statements or parameterized queries
    • Stored procedures
    • Multiple Statements
    • Transactions
    • The "new" password authentication method (on by default in MySQL 5.6; required in 5.7)
    • All of the functionality in MySQL 5.1

Since it is deprecated,  I would suggest not using it, as it would make your code less future proof.

answered Sep 7, 2018 by DataKing99
• 8,130 points

Related Questions In Database

0 votes
1 answer

What is the syntax of USE statement in MySQL?

The USE statement is used to mention ...READ MORE

answered Nov 27, 2018 in Database by darklord
• 6,170 points
88 views
0 votes
1 answer

What is the NOT Operator in MySQL?

NOT operator displays a record when the ...READ MORE

answered Dec 13, 2018 in Database by darklord
• 6,170 points
71 views
0 votes
1 answer

What is the rule to use group by, having and where clause?

Hi samar, this is a very common mistake ...READ MORE

answered Jul 2 in Database by anonymous
58 views
0 votes
1 answer

Why is MongoDB preferred?

MongoDB is considered to be best NoSQL ...READ MORE

answered Jul 24, 2018 in Database by shams
• 3,580 points
49 views
0 votes
2 answers
0 votes
1 answer

Find values in a comma separated string in a MySQL query

You can add commas to the left and ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,170 points
2,808 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,170 points
400 views
0 votes
1 answer
0 votes
1 answer

Is SELECT * harmful in Database?

There are really three major reasons: Inefficiency in ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,130 points
52 views
0 votes
1 answer

What are the manipulation functions in SQL?

There are three case manipulation functions in ...READ MORE

answered Oct 11, 2018 in Database by DataKing99
• 8,130 points
667 views