Page 1 of 1

Template with maltipal outputs in template?

Posted: Wed Feb 05, 2003 7:30 pm
by darkpgn
I am wondering do you guys know how to get my template to put out more than one item from one variable? i have it setup like this now....

Code: Select all

<?
require_once("class.FastTemplate.php3");
mysql_connect("localhost","user","pass") or die("Unable to connect to SQL server"); 
        mysql_select_db("database") or die("Unable to select database");
		$menu = "SELECT * FROM menu_left ORDER BY menu_order";
		$menu_left = mysql_query($menu);
		$menurow == mysql_fetch_array($menu_left);
$tpl = new FastTemplate("./templates");
  $tpl->define(array(
        'main'                   => "index.tpl",
      )
  );
  
$tpl->asign(array(
 "menu_left", $menurow&#1111;'menu_name']) );  
$tpl->parse(MAIN, "main");
$tpl->FastPrint();
?>
i only get one output and it ends up being the last item. can anyone help me fix this? thanks!

Posted: Thu Feb 06, 2003 3:32 am
by volka
$menurow == mysql_fetch_array($menu_left);
compares $menurow to what's returned by mysql_fetch_array(), just an = too much.
And it's only getting one row (function's name maybe is confusing, but mysql_fetch_one_row_as_array is way too long ;) )
Take a look at http://www.php.net/manual/en/function.m ... -array.php as there are also examples how to retrieve the whole result-set.

Posted: Thu Feb 06, 2003 6:05 am
by darkpgn
ok, illl look into that one. thanks for the help