4 * -------------------------------------------------------------
7 * Purpose: Interface with ADOdb Lite to return all result elements to assigned variable.
9 * db_object = Database object
10 * db_function = Database result function to execute
11 * db_result_object = Database result object
12 * db_assign = variable name to assign result data
13 * db_errornumber_assign = variable name to assign the database error number
14 * db_error_assign = the variable name to assign the database error message
15 * db_EOF_assign = the variable name to assign the database end of file flag
16 * -------------------------------------------------------------
18 function tpl_function_db_result_call($params, &$template_object)
20 if (empty($params['db_object']))
22 throw new Template_Exception("db_result_call: missing db_object parameter", $template_object);
25 if (!is_object($params['db_object']))
27 throw new Template_Exception("db_result_call: db_object isn't an object", $template_object);
30 $db = $params['db_object'];
32 if (empty($params['db_result_object']))
34 throw new Template_Exception("db_result_call: missing db_result_object parameter", $template_object);
37 if (!is_object($params['db_result_object']))
39 throw new Template_Exception("db_result_call: db_result_object isn't an object", $template_object);
42 $result_object = $params['db_result_object'];
44 if (empty($params['db_assign']))
46 throw new Template_Exception("db_result_call: missing db_assign parameter", $template_object);
49 if (empty($params['db_function']))
51 throw new Template_Exception("db_result_call: missing db_function parameter", $template_object);
54 $db_function = $params['db_function'];
56 $result = $result_object->$db_function();
58 $template_object->assign($params['db_assign'], $result);
60 if (!empty($params['db_errornumber_assign']))
62 $template_object->assign($params['db_errornumber_assign'], $db->ErrorNo());
65 if (!empty($params['db_error_assign']))
67 $template_object->assign($params['db_error_assign'], $db->ErrorMsg());
70 if (!empty($params['db_EOF_assign']))
72 $template_object->assign($params['db_EOF_assign'], $result_object->EOF
);