$q = "SELECT * FROM $sql_tbl[...] ..."; $myQueryResult = func_query($q); smarty->assign('mySmartyVar',$myQueryResult);