Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Need help in Section

 
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
manishparmar
Smarty n00b


Joined: 14 Mar 2011
Posts: 1

PostPosted: Sun Mar 27, 2011 6:38 am    Post subject: Need help in Section Reply with quote

hello people. . .
i am a smarty learner.i m facing problem in collection data from multiple table. Rolling Eyes
> 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
View user's profile Send private message
ChrisFah
Smarty Pro


Joined: 02 Nov 2009
Posts: 157
Location: Traun, Austria

PostPosted: Sun Mar 27, 2011 12:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial) 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