we are all writing our own database abstraction layers...
I don't think the datatype should depend on mySQL or Oracle, that's the goal of the abstraction layer. It really should depend on how complex our result sets are and/or what functionallity we wish for them...
for my purposes, very html-output-focused, classes must provide:
$db = new my_db(...
$db->connect(...
$table1 = new my_table (...
$query1 = new my_select_query(....
$resultset1 = $query1.execute (...)
echo ($resultset1.record[$i]['name']);
so, beneath the layer I must translate the array KIRK just told you about into my own data format (output - HTML - oriented)
first i'll set columns, names, descriptions, and html formats directly in the query
and so expect to have the same columns, with all it's attributes as a result
this result is of type my_resultset...
now, maybe my db is too simple and my page design too complex... or, my guess, in either side of the layer there's always a "emulation" surface...
try reading my usage sequence as
$db = new my_db(...
$db->connect(...
$movies = new my_table ('movies','stylesheet1')
//beneath the layer fetches this values from database, matching movies against:
$movies->field[1]->name = ...
$movies->field[1]->type = ...
$movies->field[1]->class = ...
$movies->field[1]->headerclass = ...
$movies->field[1]->description = ...
$movies->field[1]->display_lenght = ...
//values can be overriden
$color_movies = new my_select_query("select * from movies where color = true order by date");
//beneath:
$color_movies->set_all_fields($movies);
$color_movies->setcriteria('color = true');
$color_movies->orderby = 'date';
//note all relevant column attributes are read from the $movies object by the set_all_fields method
$color_movies = $query1.execute (...)
with this i should obtain:
$color_movies->table[0] = $movies
$color_movies->tablecount = 1
$color_movies->field[3] = 'description'
$color_movies->field[3]->name = 'Synopsis'
$color_movies->field[3]->type = 'nl2br'
$color_movies->field[3]->display_lenght = 250;
$color_movies->field [3]->display_more = 'link'
$color_movies->field [3]->headerclass = 'text'
$color_movies->field [3]->class = 'text'
$color_movies->fieldcount = ...
$color_movies->recordcount = ...
$color_movies->record[1]['title'] = 'Magnolia'
and in the end
$color_movies->record[1]['description']->renderedhtml = "<p class=text>Loved it<br>it's really great.</p>"
then, output:
//all the <TABLE> html
echo (my_html_table($color_movies, 100, '%', ...);
//<TABLE> and header row(s)
echo (my_html_headerrow($bw_movies, ...);
//for each row, <TR>, and </TABLE> if last
echo (my_html_row($bw_movies->record, ...);
Now, just joking, the html_functions are still site-specific but i'll write a whole site-abstraction-layer and maybe a php-version-abstraction layer.
André