I'm back...
I've decided that I like the idea of using the field names instead of the field order as the way to do token replacements:
%last_name% vs. %field2%
Now that I have made this choice I need a bit of help.
How do I set up constructs to deal with:
1) the number of returned records,
2) the number of returned fields (columns) and their names.
--pseudo-code snippet--
[FONT=courier new]// $record is a preloaded template with field tokens wrapped in '%'
// Traverse the returned recordset
while ( $row = mysql_fetch_array($result) ) {
$data = $record;
foreach ( column in $row ) {
$data = ereg_replace ('\%' . mysql_field_name($result, rownum) . '\%', $row[rownum], $data);
}
$content = $content . $data;
}
// display the recordset
echo ($content);[/FONT]
--pseudo-code snippet--
I'm not sure if the foreach above is right nor how to set up the rownum calls. Can someone fill this in with the proper syntax...
TIA
Sean Shrum