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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 42 + 17 = ?

 
 [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] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.