MySQLi-Convertor/README.md

28 lines
794 B
Markdown
Raw Permalink Normal View History

2015-10-16 10:15:01 +02:00
MySQLi Convertor
===========
2015-10-21 11:49:36 +02:00
A simple trick to convert old deprecated mysql code to mysqli in PHP
2015-10-16 10:15:01 +02:00
**IMPORTANT: Noted that converting mysql to mysqli doesn't enhance your system security. It is recommended to rewrite your system in a modern and security approach.**
2015-10-19 13:28:01 +02:00
The project currently doesn't include all of the function in mysql but you may extend it by adding corresponding functions easily.
2015-10-16 10:15:01 +02:00
SETUP
------
2015-10-19 10:59:57 +02:00
**STEP 1.** Include the convertor in your code
2015-10-16 10:15:01 +02:00
```
include 'SqliConvertor.php';
```
2015-10-19 10:59:57 +02:00
**STEP 2.** Set up the connection
2015-10-16 10:15:01 +02:00
```
$sqliConvertor = new SqliConvertor($host, $username, $password, $db_name);
```
2015-10-19 10:59:57 +02:00
**STEP 3.** Replace all the string "mysql_" to "$sqliConvertor->" in your file. If you are using Vim, you may use the following command
2015-10-16 10:15:01 +02:00
```
:%s/mysql_/$sqliConvertor->/g
```