#34379 [Opn->Csd]: Invalid example in mysqli_set_charset()

From: Date: Tue, 06 Sep 2005 07:27:43 +0000
Subject: #34379 [Opn->Csd]: Invalid example in mysqli_set_charset()
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369905@lists.php.net to get a copy of this message
ID: 34379 Updated by: vrana@php.net Reported By: profic at kursknet dot ru -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: irrelevant PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2005-09-05 21:15:34] profic at kursknet dot ru 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 this bug report at http://bugs.php.net/?id=34379&edit=1

« previous php.doc (#969369905) next »