db access in CMSMS 2
Posted: Wed Oct 05, 2016 2:37 pm
Here's my UDT called UserListing
$gCms = cmsms();
$db = $gCms->getDb();
$sql = "SELECT * FROM " . cms_db_prefix() . "module_feusers_users";
$dbresult = $db->Execute($sql);
$count = $dbresult ->RecordCount();
$result = array();
while($dbrow = $dbresult->FetchRow()) {
$result[] = $dbrow;
}
$smarty ->assign(result,$result);
$smarty ->assign(count,$count);
and my page:
{UserListing}
<p>{$count} records on file</p>
{foreach from=$result item='entry'}
<p>Email:{$entry.email}</br>
{/foreach}
$count shows correctly so I know result is being passed as I get
the correct number of lines from the loop
But the loop shows no $entry.email or any other field
What am I missing ?
$gCms = cmsms();
$db = $gCms->getDb();
$sql = "SELECT * FROM " . cms_db_prefix() . "module_feusers_users";
$dbresult = $db->Execute($sql);
$count = $dbresult ->RecordCount();
$result = array();
while($dbrow = $dbresult->FetchRow()) {
$result[] = $dbrow;
}
$smarty ->assign(result,$result);
$smarty ->assign(count,$count);
and my page:
{UserListing}
<p>{$count} records on file</p>
{foreach from=$result item='entry'}
<p>Email:{$entry.email}</br>
{/foreach}
$count shows correctly so I know result is being passed as I get
the correct number of lines from the loop
But the loop shows no $entry.email or any other field
What am I missing ?