Re: [PHP-DB] Strange action with =

2007-02-20 Thread Haydar Tuna
Hello This (=) is used in the variable references. in $ref=$array[2] line $ref variable and $array[2] variable point at the same address. if you assign any value to this any variables, both of them will change their values because echo($ref) line display b on the screen. -- Haydar TUNA

Re: [PHP-DB] Strange action with =

2007-02-13 Thread OKi98
Peter Beckman wrote: Because I'm trying to point out a problem with PHP, where setting a reference when the other side is undefined or not set, PHP creates a reference to a previously non-existent array item, just by setting a reference. I don't think that should happen. And? what's wrong

[PHP-DB] Strange action with =

2007-02-12 Thread Peter Beckman
I'm looping through an array and I did this: $rate = $mydata[$prefix]; Now, in some cases $mydata[$prefix] wasn't set/defined, so I expected $rate to not be defined, or at least point to something that wasn't defined. Instead, PHP 5.1.6 set $mydata[$prefix] to nothing. If I had:

Re: [PHP-DB] Strange action with =

2007-02-12 Thread bedul
sry i don't get what u mean?? - Original Message - From: Peter Beckman [EMAIL PROTECTED] To: PHP-DB Mailing List php-db@lists.php.net Sent: Tuesday, February 13, 2007 8:29 AM Subject: [PHP-DB] Strange action with = I'm looping through an array and I did this: $rate = $mydata

Re: [PHP-DB] Strange action with =

2007-02-12 Thread Peter Beckman
On Tue, 13 Feb 2007, bedul wrote: sry i don't get what u mean?? I'm looping through an array and I did this: $rate = $mydata[$prefix]; This is how you assign a variable by reference. $rate should be a reference to $mydata[$prefix], not a copy. If I change the value of $rate, the