Page 1 of 1

Tad Help with ADOdb

Posted: Sun Jul 23, 2006 9:35 pm
by LiveFree
Hello All,

Well say I am using Smarty now (Yes!!!!) and I am trying to iterate over a blocks table

I have a foreach loop setup with Smarty, but I cannot find a way to get each row from ADOdb.

I have this code:

Code: Select all

function show_left() {
  global $prefix, $template, $db;
  $blocks = array();
  $sql = $db->Execute("SELECT block, custom_name, content FROM ".$prefix."_blocks WHERE isActive=1 AND position=0 ORDER BY sort DESC");
  
  $template->assign("block", $sql->fields);
  $template->display("blocks_left.htm");
}
But what the end result is displayed, only the first letter of each column is displayed.

Thanks :)

Posted: Sun Jul 23, 2006 10:04 pm
by sweatje

Posted: Sun Jul 23, 2006 11:00 pm
by LiveFree
Brilliant!

Thanks.