|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bunker Smarty n00b
Joined: 18 Mar 2012 Posts: 2
|
Posted: Sun Mar 18, 2012 11:56 am Post subject: Simple Array and Template help |
|
|
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 |
|
|
|
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
|