NFO (Norman Fox) wrote:
OK so I develop in an Apache/PHP/MySQL/WinXP environment but production is on a Unix box. We recently switched production to MySQL 4.1. So I upgraded my development copy. According to you current documentation I need to be running mysqli to realize the full functionality of 4.1. Ok fine I switched my module to mysqli. Fortunately I'm using PEAR:DB for my db communication and have one central connection file so changing that from mysql to mysqli was relatively painless, but the thousands of lines of code with mysql_escape_string are not working, and a simple find and replace function will not work because mysqli_escape_string requires different parameters (yes I can and will replace it with addslashes, but I've always felt mysql_escape_string was more robust for MySQL).

So first this is a bit of a cathartic rant after 1+ weeks of on and off attempting to get my development environment to function with my production environment (I can't be the only one out there whose sandbox runs on their local windows box, but runs production on a Unix server).

I understand the problem you're having, but I don't think documentation would solve your issue.


It seems that your implementation of DB abstraction broke down when you used an engine's native escaping method. You want $db->escapeSimple().
(http://pear.php.net/manual/en/package.database.db.db-common.escapesimple.php)


Second could you please elaborate on the following (perhaps with a few examples 
that are more detailed than those in the mysqli comments:)

If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts.

I'm, personally, not knowledgeable on mysql vs. mysqli, but your best course of action, here, is to file a documentation bug at http://bugs.php.net/ Someone will either fix it, or determine that it's clear enough, already.


I can't believe it never occurred to you that backwards compatibility would be useful

Backwards compatibility has always (well, almost) been a priority of PHP. How else would you explain the mess in the string/array libraries? (-:


S

Reply via email to