Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Ayuda mostrar en template elementos array

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
bunker
Smarty n00b


Joined: 18 Mar 2012
Posts: 2

PostPosted: Sun Mar 18, 2012 11:51 am    Post subject: Ayuda mostrar en template elementos array Reply with quote

Hola,

Primer post.. a ver si me ayudais con un tema seguro muy simple...

tengo esto:

Code:
    $sql_query             = "SELECT * FROM listing";
   $rResult               = mysql_query($sql_query) or die(mysql_error());

   while ($row = mysql_fetch_assoc($rResult))
{
   
   $aArray[$row['listing_id']] = $row;
   
}

    $smarty->assign('rows', $aArray);


y lo que quiero es un template mostrar algo asi:

Code:
{$rows[52].listing_description_1|truncate:250}


Pero cambiado 52 por el valor de listing_id

listing_id es un string entiendo, y por eso no me muestra nada...

Gracias x adelantado!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP