php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32420 mysql_query leaves Data unchanged when Data is echo'ed
Submitted: 2005-03-23 00:37 UTC Modified: 2005-03-23 23:46 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: impic at web dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.3 OS: Linux 2.4.27
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: impic at web dot de
New email:
PHP Version: OS:

 

 [2005-03-23 00:37 UTC] impic at web dot de
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-23 23:46 UTC] sniper@php.net
Without a reproduce code there's absolutely nothing we can do -> bogus.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 05:01:31 2024 UTC