Greetings, all. I'm having some problems assigning one array to another. The source array is actually a member of an object, and it is filled from an SQL query. I want to copy the array into a local variable through a method of my object, but it doesn't seem to be working. Am I doing something wrong? Here's the relevant code:
// Here is where the array is initialized in the object
var $disc_info = array();
...
while ($disc_info[] = $db->sql_fetchrow($result)); // phpBB code, similar to msyql_fetch_assoc()
// The method that returns the array
function disc_info()
{
return $this->disc_info;
}
// Assigning to local array
$disc_array = $bootleg->disc_info(); // bootleg is the name of the instance, obviously
However, when I output the local array using print_r between PRE tags, it shows as empty. Why?
Array
(
)
1
Any help would be awesome. I'm sure I'm missing something, probably very simple to boot.
James