Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #8807 Parameter order is wrong in fallback code in setCharset()
Submitted: 2006-09-28 12:17 UTC
From: fredrik at wangel dot net Assigned: lsmith
Status: Closed Package: MDB2_Driver_mysqli (version 1.2.2)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-09-28 12:17 UTC] fredrik at wangel dot net (Fredrik Wangel)
Description: ------------ MDB2_Driver_mysqli::setCharset(): If the mysqli_set_charset() function is missing, the fallback code tries to call mysqli_query() with a query prepared using mysqli_real_escape_string(). However, the order of the parameters to these two functions is incorrect, resulting in PHP warnings. Test script: --------------- A patch to fix this bug: 527,528c527,528 < $query = "SET character_set_client = '".mysqli_real_escape_string($charset, $connection)."'"; < $result = @mysqli_query($query, $connection); --- > $query = "SET character_set_client = '".mysqli_real_escape_string($connection, $charset)."'"; > $result = @mysqli_query($connection, $query); Expected result: ---------------- No warnings, no errors. Actual result: -------------- Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, string given in E:\apache\php\pear\MDB2\Driver\mysqli.php on line 527

Comments

 [2006-09-30 10:26 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!