SOLVED: UDT that fails after upgrade to Hyacinthe
Posted: Wed May 09, 2012 7:59 am
Duketown and Jos helped me (http://forum.cmsmadesimple.org/viewtopi ... 28&t=55565)
with the UDT code below. After upgrading from Fanui to Hyacinthe, I get the following error:
I have tracked down that this line is where the error occurs
I am assuming that the way the database is to be referenced has been changed slightly in the upgrade, but am way outside my competency.
If anyone could check this I would be most grateful.
Andrew Prior
with the UDT code below. After upgrading from Fanui to Hyacinthe, I get the following error:
I know the UDT referred to by the error message is the one below as I have three UDTs based on it, and when I bracket them out everything else works.Fatal error: Call to a member function Execute() on a non-object in /home/blahblah/public_html/lib/classes/class.usertagoperations.inc.php(260) : eval()'d code on line 7
Code: Select all
// Make a connection to the database
$db = cmsms()->db;
//SHOULD BE $db = cmsms()->GetDb();
// $query = 'SELECT * FROM '.cms_db_prefix().'pics WHERE num=7';
$query = "SELECT * FROM ".cms_db_prefix()."pics ORDER BY RAND() LIMIT 0,1";
$dbresult = $db->Execute($query );
// Now show the images information
while ($dbresult && $row = $dbresult->FetchRow())
{
$num = $row['num'];
$alt = $row['alt'];
$title = $row['title'];
echo '<img src="uploads/images/sidebars/side_'.$num.'.jpg" alt="'.$alt.'" title="'.$title.'" />';
echo "\n";
}
Code: Select all
$dbresult = $db->Execute($query );
If anyone could check this I would be most grateful.
Andrew Prior