From: php_debugger at yahoo dot com Operating system: Windows XP PHP version: 5.2.1 PHP Bug Type: MySQL related Bug description: mysql_real_escape_string
Description: ------------ I have met this "bug" while I was creating a Russian site. I have a web form(ENCODING:UTF-8) and a simple query(My db uses UTF-8). When I submit the form, I get an error which says that the string is too long for the column but it is not the case(I just type the letters). After a while debugging I have found out what is the problem. When I use mysql_real_escape_string() I get the error else I do not. I have searched in the php site but I found nothing which has to do with encoding. Reproduce code: --------------- //I will give only the php code though it is very simple <?php //MySQL connections and other stuff like this has been omitted because //of the code's size $name = mysql_real_escape_string($_POST['name']); mysql_query("insert into users set name='".$name."'); ?> Expected result: ---------------- No errors. Actual result: -------------- MySQL error which says that the string is too long. -- Edit bug report at http://bugs.php.net/?id=41227&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41227&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41227&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41227&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41227&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41227&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41227&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41227&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41227&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41227&r=support Expected behavior: http://bugs.php.net/fix.php?id=41227&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41227&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41227&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41227&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41227&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41227&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41227&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41227&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41227&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41227&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41227&r=mysqlcfg