#39282 [NEW]: char 39 & mysql

From: Date: Fri, 27 Oct 2006 16:45:36 +0000
Subject: #39282 [NEW]: char 39 & mysql
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104075@lists.php.net to get a copy of this message
From: mak at icnet dot ru Operating system: FreeBSD 5.4-STABLE, 6.1-RELEASE PHP version: 5.1.6 PHP Bug Type: Feature/Change Request Bug description: char 39 & mysql Description: ------------ Good Day! When i'm trying to add string to mysql (using mysqli) which contents char with code 39, mysql does not give me an error, but don't add this line to mysql Reproduce code: --------------- function _encode($val, $key, $iv) { $iv = substr($iv, 0, 8); $cipher = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'cbc', ''); mcrypt_generic_init($cipher, $key, $iv); $ret = mcrypt_generic($cipher, $val); mcrypt_generic_deinit($cipher); return $ret; } ... // encoded string (may contain char 39) $msumm = _encode("12345", "some_key", "some_vector"); ... mysqli_query($db, "INSERT INTO table(date, in) VALUES(time(), $msumm)"); Expected result: ---------------- MySQL have to contain new row with values Actual result: -------------- MySQL fails to add new line, but don't give me any error -- Edit bug report at http://bugs.php.net/?id=39282&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39282&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39282&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39282&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39282&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39282&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39282&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39282&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39282&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39282&r=support Expected behavior: http://bugs.php.net/fix.php?id=39282&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39282&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39282&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39282&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39282&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39282&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39282&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39282&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39282&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39282&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39282&r=mysqlcfg

« previous php.bugs (#104075) next »