PHP Classes
elePHPant
Icontem

PHP MySQL to MySQLi: Replace mysql functions using the mysqli extension

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (21)   Blog (3)    
Last Updated Ratings Unique User Downloads Download Rankings
2016-11-02 (9 months ago) RSS 2.0 feedStarStarStarStar 75%Total: 2,837 This week: 21All time: 1,291 This week: 32Up
Version License PHP version Categories
mydql2i 1.4Public Domain5PHP 5, Databases
Description Author

This class can replace the mysql functions using the mysqli extension.

It provides equivalent functions that perform the same operations as the mysql extension when this is not available.

An auxiliary script is provided to provide global functions with the same names and parameters as mysql extension functions except that they call the class to use the mysqli extension.

Recommendations

Best PHP mysql to mysqli or PDO solution
How to convert mysql code to use mysqli?

mysql to mysqli
looking for mysql2i

Innovation Award
PHP Programming Innovation award winner
June 2015
Winner


Prize: One downloadable copy of PhpED Professional
The original MySQL extension is being deprecated and will be removed from the core starting from PHP 7.

There is a lot of legacy applications that need to be updated to either move to mysqli or PDO extensions so they can work on PHP 7.

However, this process is not always trivial, as it is not just a matter of replacing the names of functions that are called.

This package provides a quick replacement of the mysql extension functions that use the mysqli extension functions instead. This way the legacy application can continue to work on PHP 7 or later with minimal changes.

Manuel Lemos
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 34 packages by
Country: United States United States
Age: 52
All time rank: 16919 in United States United States
Week rank: 5 Up1 in United States United States Up
Innovation award
Innovation award
Nominee: 24x

Winner: 5x

Details

The problem

PHP has deprecated the mysql extension which will be removed in PHP 7. Even though it was recommended to use the improved extension, mysqli, many developers continued to use mysql.

The effect

Once PHP 7 is released in mid November of this year, 2015, many hosted servers will upgrade and scripts still relying on the old mysql extension will fail.

There are lot of web sites using legacy packages that are no longer supported by the developer and not all developers have had time to update their current packages to the improved mysqli extension.

The solution

The PHP mysql to mysqli package was developed to be the stop gap to keep everything working smoothly.

It can be placed in any PHP script, at anytime, and when the mysql extension disappears, it will take over. It works by defining functions using the old mysql function names and passing the arguments to the class methods that will use the improved mysqli extension.

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example Usage
Plain text file mysql2i.class.php Class Main Class
Accessible without login Plain text file mysql2i.func.php Aux. Functions
Accessible without login Plain text file readme.md Doc. Additional Information

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,837
This week:21
All time:1,291
This week:32Up
User Ratings User Comments (8)
 All time
Utility:97%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:88%StarStarStarStarStar
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:75%StarStarStarStar
Rank:122
 
Perfect!
6 months ago (Pedro Garcia)
80%StarStarStarStarStar
nice
9 months ago (muabshir)
80%StarStarStarStarStar
Thanks a lot for this code!!
1 year ago (Thierry Lemaire)
72%StarStarStarStar
Thanks for your great work.
1 year ago (Paco Perez)
80%StarStarStarStarStar
"does what is says on the tin" thanks.
1 year ago (Fred Mac Donald)
80%StarStarStarStarStar
Excellent support by the author
1 year ago (Heinz Ernst)
65%StarStarStarStar
Great and very useful! Thank you for sharing this.
2 years ago (Terry Woody)
67%StarStarStarStar
Thanks for the class, its really useful.
2 years ago (Saahisht Paul)
70%StarStarStarStar