#34379 [NEW]: Invalid example in mysqli_set_charset()
| From: | profic at kursknet dot ru | Date: | Mon, 05 Sep 2005 19:15:36 +0000 |
| Subject: | #34379 [NEW]: Invalid example in mysqli_set_charset() | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969369899@lists.php.net to get a copy of this message | ||
From: profic at kursknet dot ru
Operating system: irrelevant
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Invalid example in mysqli_set_charset()
Description:
------------
if's branches in both examples for mysqli_set_charset are swapped.
Reproduce code:
---------------
Manual caliming:
Returns TRUE on success or FALSE on failure.
But example reads:
if ($mysqli->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $mysql->error);
} else {
printf("Current character set: %s\n", $mysqli->character_set_name());
}
Inconsistence. Or mysqli_set_charset() returns false on success, or
missing ! in if, or branches swapped by mistake.
Expected result:
----------------
if ($mysqli->set_charset("utf8")) {
printf("Current character set: %s\n", $mysqli->character_set_name());
} else {
printf("Error loading character set utf8: %s\n", $mysql->error);
}
--
Edit bug report at http://bugs.php.net/?id=34379&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34379&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34379&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34379&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34379&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34379&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34379&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34379&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34379&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34379&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34379&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34379&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34379&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34379&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34379&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34379&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34379&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34379&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34379&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34379&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34379&r=mysqlcfg