From: impic at web dot de Operating system: Linux 2.4.27 PHP version: 5.0.3 PHP Bug Type: MySQL related Bug description: mysql_query leaves Data unchanged when Data is echo'ed
Description: ------------ This is really strange, and i tried a lot of things before i decided to write a bug report on this - I know you guys are busy. The bad news is that i cannot provide any reproduce code and since that is the case it will probably not help you, but maybe there are more users who have this problem and may be able to reproduce it. The scripts are 300kbs in size and ~20 files all included by each other, i already extracted all the relevant code and wrote it into one file but then it worked! I tried it on different PHP versions, 5.0.3/4.3.10 with and without gd support - every time the same result. I reactivated register_globals, that's everything i changed in php.ini. I use PHP with the newest version of Apache2. Now the problem is easy to explain but impossible to understand (at least for me): I do a mysql_query("UPDATE table SET somevalue = ".$somedata["id"]); If I now end the script with die("end"); or something like that, everything is fine. When I echo $somedata["id"]; first, the correct output is displayed, but when i now look into the Database, "somevalue" is empty! I can't even say if it is updated and overwritten again or if it is never updated. mysql_affected_rows returns 1 in any case. No mysql_error. When I echo the mysql_query-data that is sent and paste it directly into mysql-client, it works too. (I get $somedata["id"] from a <form method="POST">) I know it is very hard for devs to see where the problem is, but since this is the second time I got this problem, I decided to write it here so you are at least noticed of the fact that there is some kind of memory mismanagement(?) or something else. If you want me to upload all the code, I can do - but maybe it is easier to take a look into php's source to see something... My guess is that it has something to do with the way, php handles the data it gets from the POST. -- Edit bug report at http://bugs.php.net/?id=32420&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32420&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32420&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32420&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32420&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32420&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32420&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32420&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32420&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32420&r=support Expected behavior: http://bugs.php.net/fix.php?id=32420&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32420&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32420&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32420&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32420&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32420&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32420&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32420&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32420&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32420&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32420&r=mysqlcfg