Be for warned that I am new to smarty and for some reason I'm
finding it very difficult to learn.  ???  Anyway, my question is how do
I access an array of associative arrays via the {section} statement?

Heres the code:


Function readComment( &$smarty, $bid ) {


  // this code is contained within a class that uses pear db.
  // I pass by reference the smarty object that was created
  // in the main php script.  I have already performed the
  // sql query and checked for any db errors, heres how the
  // data gets assigned.

  while( $row = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) {
    $rowdata[$i] = $row;
  $smarty->assign("comments", $rowdata);


<TITLE>Smarty Test</TITLE>
{* $action is assigned to smarty in the main php script. *}
{if $action eq "read"}
  {if count($comments) gt 0}
      <table align="center" border="1">
          {section name=idx loop=$comments}
            <tr bgcolor="{cycle values="#cccc99,#d0d0d0"}">
            <tr><td colspan="2">sorry, no data avaliable</td></tr>
    <center>sorry, no data avaliable</center>
  <center>action != read</center>


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/2002

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to