I have a PHP class called htmltemplate() that populates an html form 'auto-magically' using tag placeholders from php. I use php code to generate some dynamic content and then pass the information to an html page using my template class.
What I am attempting is to generate a database result set and pass the data into my html using a tag place holder.
I want my {CONTENT_DATA} tag to be the entire result of an odbc query (Microsoft Access using an odbc driver).
The query works fine, but for some reason the output of the odbc_result_all() command outputs my table directly into my page without going through the template (The resulting table shows up at the top of my page, bypassing the html template.)
All I get in CONTENT_DATA, ie. $Table is the record count of the odbc_result_all() function --- not the entire table as I had hoped.
Anybody know how I can output the entire result to my template?
// Include the class module
require_once ("classes/HtmlTemplate.class");
// HTML Template for Content
$content = new HtmlTemplate ("templates/Database_template.inc");
// Query the database and produce a result set table
$ContentDataQuery = "Select * from LogBook";
$ContentDataExec = odbc_exec ($db_connection, $ContentDataQuery);
$Table = odbc_result_all ($ContentDataExec);
// Use htmltemplate() class to send data to your html page
$content->SetParamater ("CONTENT_DATA", $Table);
$html_content = $content->SwapParamaters();
Any suggestions on code improvement also are welcome.
Thank you,
Justin Wood