[SOLVED] Issue with RecordCount?
Posted: Wed Apr 25, 2012 10:18 am
Hello,
I'm working on a module and I'm having trouble with getting the RecordCount from adodblite with the most recent cms 1.10.3 to give me any answer at all.
The code is very simple and is working on an older installation, here's a snippet of the function:
This is admin side, and the code always bails at the $dbresult->RecordCount() call with "PHP Fatal error: Call to a member function RecordCount() on a non-object in..."
I've tried a few methods of initialising the db, all with the same results. Is this a bug or am I being stupid? Personally, I know what my money's on!
Thanks in advance if anyone can show me where I'm going wrong.
Regards,
Mark.
I'm working on a module and I'm having trouble with getting the RecordCount from adodblite with the most recent cms 1.10.3 to give me any answer at all.
The code is very simple and is working on an older installation, here's a snippet of the function:
Code: Select all
function _listTypes() {
//provide list of type objects as an array
//$gCms = cmsms();
$db = cmsms()->GetDb();
//$db = $gCms->GetDb();
//run the query
$query = "SELECT typ.* FROM ".cms_db_prefix()."module_msx_types AS typ ORDER BY typ.xTypeOrder ASC, type.xTypeName ASC";
$dbresult = $db->Execute($query);
$this->typeCount = $dbresult->RecordCount();
//blah....
}
I've tried a few methods of initialising the db, all with the same results. Is this a bug or am I being stupid? Personally, I know what my money's on!

Thanks in advance if anyone can show me where I'm going wrong.
Regards,
Mark.