Strange but true!

From: Date: Mon, 21 Aug 2000 12:05:39 +0000
Subject: Strange but true!
Groups: php.general 
Request: Send a blank email to php-general+get-12750@lists.php.net to get a copy of this message
I need some explanation on this please! I wanted to make a double dimensional array for use in my program. I wrote something like: while($row = mysql_fetch_array($sql_result)) { $name[$num] = $row["name"]; $ip_address[$num] = $row["ip_address"]; $num++; } I was allowed to (re-)consider again and again about the first array name and it was getting values like you normally get in a string. That is, "romi", "rRmi", "rRMi", "rRMR" ... basically, the next name's first character from database was getting appended onto the string because of the logic. And in the second array, I was getting the values as they should have gone normally! Like, "192.178.35.163", "192.178.35.164", "192.178.35.165" and the like .... I changed the name of first array to $user_name and it started behaving as a double dimensional array ... started getting values like "romi", "Roma", "Momma" and "Romy". That sure is strange ... please help me understand the in-core intricacy involved in this! -Romi

« previous php.general (#12750) next »