Code: Select all
class Course {
// snip...
public function RegisterField($fieldName, $fieldDesc){
echo "Registering field '$fieldName' as '$fieldDesc'... ";
$this->$fields[$fieldName] = new DataField($fieldDesc);
echo "Registered.\n";
}
// snip...
but it never gets to "Registered", and doesn't register any of the fields after that one. I'm not sure why this doesn't work, and from what I've read I can use objects as values in an associative array. Can someone explain what's wrong and/or how to fix it (if it's easily reconciled)?Registering field 'autoindex' as 'int( 11 ) NOT NULL AUTO_INCREMENT'...
Other code that might be pertinent:
Code: Select all
class DataField {
// snip...
function DataField($field){
$this->fieldDesc = $field;
$this->fieldValue = "";
}
// snip...
}
Thanks!