ID: 27507 Updated by: [EMAIL PROTECTED] Reported By: alexandre at z-index dot com dot br -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Windows 2000 SP4 PHP Version: 4.3.4 New Comment:
You need to return the value yourself from the function with the 'return' keyword. Previous Comments: ------------------------------------------------------------------------ [2004-03-05 13:18:21] alexandre at z-index dot com dot br A find out that any time that a refresh de page (posting again) those strange chars follow an order... i think itīs kind a ascii table... a got 0,1,2,3,4...9,:,;,<,= instead the real value for mysql_insert_id($this->Conexao) was 56,57,58 e etc... ------------------------------------------------------------------------ [2004-03-05 12:40:20] alexandre at z-index dot com dot br Description: ------------ This problem happens when a call a specific method from a class and when a i try a echo this values strange chars (+,*,),#) apear than the real data value. Here goes the sample script: Reproduce code: --------------- <? class y { function x() { $query = "any insert"; $resultado = mysql_query($query); $id = mysql_insert_id($this->Conexao); echo "<br>inside function ".$id; } } $z = new y(); $x = $z->x(); echo "<br>outside function".$x; ?> Expected result: ---------------- inside function 12 outside function 12 Actual result: -------------- inside function 12 outside function ( or inside function 12 outside function * or inside function 12 outside function # ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27507&edit=1