php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #39282 char 39 & mysql
Submitted: 2006-10-27 16:45 UTC Modified: 2006-10-27 21:45 UTC
From: mak at icnet dot ru Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.1.6 OS: FreeBSD 5.4-STABLE, 6.1-RELEASE
Private report: No CVE-ID: None
 [2006-10-27 16:45 UTC] mak at icnet dot ru
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-27 21:45 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 18:01:36 2024 UTC