Tad Help with ADOdb

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Tad Help with ADOdb

Post 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 :)
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Brilliant!

Thanks.
Post Reply