Originariamente inviato da francy2
Codice PHP:
<?php
function Create(&$m ''){
global 
$smarty,$db_prefix;
    
$q=mysql_query('SELECT * FROM '.$db_prefix.'menu ORDER BY id desc');
    while(
$ex mysql_fetch_array($q,MYSQL_ASSOC)){
        
$m .= $ex;
    }
    
$smarty->assign('menu',array($m));
}
?>
Questo è quello che ha fatto! Una funzione richiamabile dal file di template di smarty che crea il menù interrogando il db.
a me servirebbe fare in modo che si crei dentro la var un cosa del genere
Codice PHP:
$smarty->assign('menu',array(array('ide'=>$ex['ide']),array('ide'=>$ex['ide']))) 
ecc...
come posso fare
Questo è quello che vorrebbe ottenere.

La funzione che hai creato per smarty la devi usare direttamente nel file php. Quello che ti viene restituito lo passi a smarty come t ho detto sopra (cioè come con $smarty->assign).