Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2008, 03:28 PM
Junior Member
 
Join Date: Feb 2008
Posts: 1
Default nested stuff?

i installed zf tried some stuff. really impressive how easy some things are working. but there is something i have no idea to solve (without using things like smarty).

lets take this example: i do have 2 tables in my database.
first one:
- username
- name

second table:
- username (FK)
- friendname


so every user can have several friends in table 2.

when doing just normal php something like that would be fine:
Code:
foreach username (table 1)
{
   print username;
   foreach username (table 2)
   {
      print friend;
   }
}
i tried something like that in my indexAction
Code:
$result = $db->fetchALL("select * from usertable");
$this->view->username = $result;
in the index.phtml i did
Code:
foreach ($this->username as $user)
{
  echo $user['username'] . "<hr>";
}
how can i now get the friendlist in my html output? i have no idea how to do those nested suff.

can anyone help me with this probably basic stuff?

thanks alot

-andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:47 PM.