|
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 |
manishparmar Smarty n00b
Joined: 14 Mar 2011 Posts: 1
|
Posted: Sun Mar 27, 2011 6:38 am Post subject: Need help in Section |
|
|
hello people. . .
i am a smarty learner.i m facing problem in collection data from multiple table.
> how to access all the DATA if we send then to TEMPLET file as a ARRAY?
here m giving my query
$p="SELECT a.count_name,c.first_name,b.profile_photo
FROM tblcountry AS a, tblprofile AS b,tblmember as c
WHERE a.count_id = b.country AND b.mem_id=c.id";
$prc=mysql_query($p);
while($pm=mysql_fetch_array($prc))
{
$pp[]=$pm;
}
$smarty->assign('Pdata',$pp); |
|
Back to top |
|
ChrisFah Smarty Pro
Joined: 02 Nov 2009 Posts: 159 Location: Traun, Austria
|
Posted: Sun Mar 27, 2011 12:11 pm Post subject: |
|
|
Hi,
have a look at {foreach} in documentation.
{foreach from=$Pdata item=data}
{$data.count_name} {$data.first_name} dosomething withit
{/foreach}
Regards, Chris |
|
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
|