Edit report at http://bugs.php.net/bug.php?id=54046&edit=1

 ID:                 54046
 Updated by:         [email protected]
 Reported by:        matze73 at hallo dot ms
 Summary:            with multiple Mysql Links, data disappears/reappears
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            MySQL related
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


Previous Comments:
------------------------------------------------------------------------
[2011-02-18 15:58:29] matze73 at hallo dot ms

Description:
------------
[please note: actually, this problem occurs with 5.3.3. I have currently
no option to upgrade the php package. ]



I am working with two mysql links. 



Basically, I observed that with entering another block / STACK frame,
previously retrieved data disappears , upon return it re-appears. 



It is no SCOPE problem, because the problem goes away when working with
just one mysql database link.



Long story:



There is some small amount of data retrieved from the first link, which
is put into an array ( instance member $this->a );



Then, *inside* an switch-block the array is missing its elements
retrieved from the database. But after the switch-block the array is
intact again .. !!



After years of PHP coding I never had such a case. Very curious indeed.
I tried two workarounds:



1. copy the array into $_SESSION

2. convert the array via print_r ($a, true) to a string 



The truly NASTY thing is, even with option #2 the resulting string
changes during the switch statement (looses data) - and is intact again
afterwards.



The same effect when calling an instance method: elements retrieved from
the first database link have disappeared.



The problem is only with data retrieved from the first mysql link.



Helpful workaround: when I move the table from the first database to the
second database (i.e. just working with one mysql link), the problem
disappears altogether.



The VERY strange thing is, that the data even disappears/reappears when
converted via print_r( $x, true) ...





Actual result:
--------------





------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54046&edit=1

Reply via email to