I am using the following code to load my object classes;
function __autoload($class_name) {
require_once ( 'classes/'.$class_name.'.class.php');
}
If would like it so that if it can't find the file, it goes to the Database, finds the table of the data item i'm trying to access. And creates a standard object on the stop which contains the variables which represent the columns in the DB. Is this possible? I know how to check if the file exists with PHP, but I'm not quite sure how I would return the new standard object once initiated with the correct variable names.
Many thanks.