Hi,
I am using Smarty template engine for a project and I was wondering whether there is a way tos save one step of assigning values to variables to each variable we want to use in the template. That is, a way we can pass in a hash of a MySQL Result object and so, the only modification is on the template and the SQL query structure.
Any ideas whether Smarty can do this, and how.
$query = mysql_query("SELECT id, ip FROM table";
while ($row = mysql_fetch_assoc($query))
{
$smarty->assign("test",$row);
}
We were experimenting of passing this and in our template identify where we want the array placed. Any ideas?