PEAR::DB -> ADOdb

From: Date: Wed, 29 Dec 2004 16:03:40 +0000
Subject: PEAR::DB -> ADOdb
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12084@lists.php.net to get a copy of this message
In my DB code I have: $mode = DB_FETCHMODE_ASSOC; $data = $dbh->getAll($stmt, $mode); $page->assign('data', $data); This prints out nicely in my template. I am trying the SelectLimit in ADOdb (to learn some things) and I have this: $startRow = 1; $numRows = 5; $db->SetFetchMode(ADODB_FETCH_ASSOC); $result = $db->SelectLimit($sql,$numRows,$startRow); $page->assign('data', $result); This prints nothing at all... I do a print_r on $result and it returns what I think it should. I get 5 arrays [0->4]: [0] => Array ( [SURNAME] => LAST [FIRST_NAME] => FIRST [USERID] => FILAST [EMAIL] => [PROFILE] => PROF [POSITION] => POS [PRIMARY] => 0 [LAST_ACC_DATE] => 20041015 [PROFILE_LOGIN_LCKD] => N ) etc... In my template I do this: {section name=set loop=$data} <tr class="{cycle values="trcol1,trcol2"}"> <td>{$data[set].SURNAME}</td> <td>{$data[set].FIRST_NAME}</td> <td>{$data[set].USERID}</a></td> <td>{$data[set].PROFILE}</td> <td>{$data[set].POSITION}</td> {if $data[set].PRIMARY eq "1"} <td>YES</td> {else} <td>NO</td> {/if} <td>{$data[set].LAST_ACC_DATE}</td> {if $data[set].PROFILE_LOGIN_LCKD eq "N"} <td>NO</td> {else} <td>YES</td> {/if} {if $data[set].EMAIL eq ""} <td>&nbsp;</td> {else} <td><a href="mailto:{$data[set].EMAIL}"><img src="images/email.gif" alt="mail icon" /></a></td> {/if} </tr> {/section} Everything works fine with DB so I am at a loss and I probably don't understand with SelectLimit is actually doing. Robert

« previous php.smarty.general (#12084) next »