Skip to content

Commit

Permalink
Merge pull request #48 from staabm/patch-1
Browse files Browse the repository at this point in the history
Added note about alternative approaches
  • Loading branch information
dshafik authored Jan 2, 2020
2 parents 8c29c45 + 59ca7ca commit 8fadc66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ Once the `lib/mysql.php` file is included, it will create `mysql_*` functions if
- Calls to `is_resource()` and `get_resource_type()` on MySQL connections and results will fail as these are now their `mysqli` equivalents.
- Some errors are now from `ext/mysqli`, and others are `E_USER_WARNING` instead of `E_WARNING`.
- You must use the `mysqli.*` INI entries instead of `mysql.*` (e.g. `mysqli.default_user` instead of `mysql.default_user`)
- If no host, username, password parameter is provided when using the `mysql_*` functions, the default values from the corresponding `mysqli.*` settings from `php.ini` file will be used (e.g. `mysqli.default_host`, `mysqli.default_user`, `mysqli.default_pw`)
- If no host, username, password parameter is provided when using the `mysql_*` functions, the default values from the corresponding `mysqli.*` settings from `php.ini` file will be used (e.g. `mysqli.default_host`, `mysqli.default_user`, `mysqli.default_pw`)

## Alternatives

Instead of using this drop-in-replacement library you should consider refactoring your code from `mysql` to e.g. `mysqli`. This process can be automated with e.g. https://github.com/rectorphp/rector/blob/master/docs/AllRectorsOverview.md#mysqltomysqli

0 comments on commit 8fadc66

Please sign in to comment.