adding vars to array

From: Date: Fri, 12 Jul 2002 12:03:40 +0000
Subject: adding vars to array
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5263@lists.php.net to get a copy of this message
Hi, At this moment, i'm using arrays with smarty like this: $t = new Smarty(); $array1 = $array2 = $array3 = . = array(); $db->query(". my sql query ."); while ($row = $db->fetch_array()) { array_push($array1,$row['field1']; array_push($array2,$row['field2']; . } if ($db->num_rows()) { $t->assign("date",$array1) . $t->display(.) } Is it possible to add vars to an array with using Smarty, so I can do something like: $t = new Smarty(); $db->query(". my sql query ."); while ($row = $db->fetch_array()) { $t->addvar("date",$row['field1']); . } if ($db->num_rows()) $t->display(.) I hope you unstand me :) , but I couldn't find anything about is in the doc-files. Thanks, Peter

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