Ok, been fighting with this for most of the day and don’t want to do a total re-write of my code.
I’ve got a few classes defined, importing them into the page, instanciating the objects, putting data into the classes, pulling data back out of the classes. In short, everything is working the way I want it to accept, I can’t seem to get my classes and arrays working correctly.
What I want to do is drop objects, from 1 to many into an array and then get the data back out. I seem to be able to drop the objects into the array, but I can’t get data back ouf from the array. Is there anyway to do this. Below is part of my class and how I’m putting the data into the array.
Class ------
class Attribute {
var $name;
function SetName($name) {
$this->name = $name;
}
function GetName() {
return $this->name;
}
}
Code that puts the class info into the array-----
for( $i = 0; $i < $totalMatch; $i++)
{
$matchRow=mysql_fetch_array($raceMatch);
$dXAttribute[$i] = $dXCharacter->SetName($matchRow[rule_name]));
}
This is pulling data out of an SQL result set query. I’ve tried everything I can think of to get the information back out of the array, but don’t get anything printed to the page.
Thanks in advance for any information you can give me to help fix this problem.
Oh yeah, I've looked at all of the posts about classes/objects and arrays and can't find the answer to my query. At least all of the ones I could find by a search.
Skunk