Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Simple Array and Template help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
bunker
Smarty n00b


Joined: 18 Mar 2012
Posts: 2

PostPosted: Sun Mar 18, 2012 11:56 am    Post subject: Simple Array and Template help Reply with quote

Hi all,

Simple array and template question: Ive got the following code:
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);


And in the template I want to show something like this:

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


But changeing value 52 for the listing_id...

listing_id is a string.. so.. i dont know how to continue..

Thx in advanced!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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