Jump to content
Sign in to follow this  
Zippy Aus

Help with Code ... replace appendNth Calculation

Recommended Posts

<?php echo $infoData['FullName'][0];?>

<?php echo $infoData['Title'][0];?>

<?php echo $infoData['Group'][0];?>

Contact Details

Direct dial: <?php echo $infoData['Telephone'][0];?>

Email:

<?php echo $infoData['Email'][0];?>

Other <?php echo $infoData['Group'][0];?> Members

<?php

foreach ($infoResult['data'] as $key => $infoData)

{

?>

<?php echo $infoData['TeamMembers'][0];?>

<?php

}

?>

Edited by Guest

Share this post


Link to post
Share on other sites

ZP

I'm going to assume all your team members are related on Group...

It would seem that after you do your first query using the UserID, you would want to do a second query on that user's Group to pull all those Group/team member records (if not Group, then use the correct linking field).

You should be able to have multiple results simultaneously. The first one is being stored in $infoResult, the second might go into $teamResult.

Once you have that, just loop through the $teamResult array, echoing the name fields as you go.

You may find it helpful to get a better little understanding of how these php arrays work and what you can do with them. The php manual online is an excellent resource. You could start your reading here: http://us3.php.net/manual/en/language.types.array.php

Happy holidays

Don

Share this post


Link to post
Share on other sites

Thanks Don

Yeah, I will have to do a bit of reading to wrap my head around PHP and advance my knowledge. I seem to be able to get the basics but that is as far as I go.

I will try what you suggested and also RTFM B)

thanks again

Zippy

Share this post


Link to post
Share on other sites

Z

Another thing to look at in the manual is the section on Classes. This is a much more difficult topic (for me at least) but it would help to understand that fx.php is a class and you can create simultaneous, independent objects from the class... well, don't count on my use of the terminology associated with classes.

The O'Reilly book, PHP in a Nutshell has also been a useful get-your-feet-on-the-ground resource for me.

Truth is, I can barely understand anything about classes from the online manual. I can at least understand general principles when I read the O'Reilly book.

Since you're already dipping into php, I'll give you my standard recommendation of Scodigo's SmartPill. This inexpensive plug-in gives you PHP in the filemaker calculation engine. I can't begin to tell you all the amazing things I do with filemaker since I added this one plug-in.

Don

Share this post


Link to post
Share on other sites

Classes are just an encapsulated set of functions, variables and behaviors - It takes a while to get this straight in your head, but trust me, the benefits are amazing once your code starts becoming clear and consistent on the page, but more so when you start reusing your code b/w projects ...

For Class theory in general, look up PHP OOP - aka Object Oriented Programming - its much more of a reality with PHP 5 than it ever was with 4.

This is a pretty in depth explanation:

http://www.pretechno.com/i/object-oriented-approach-oops-in-php.html

Edited by Guest

Share this post


Link to post
Share on other sites

genx

thanks for the link. I have a feeling of the benefits that will come, and I have been able to lift classes, dump them into the fm calc engine (using smartpill) and use them... That's not the same as really knowing them. Cookbooking is good though!

I found a php vCard read/write class the other day. I have (on my to-do list) a project to use it as a basis for integrating the Apple AddressBook app with FM.

Thanks again for the link. Reading these explanations from various writers is helpful.

Regards,

Don

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    2 members have viewed this topic:
    Veselko  nexgen 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.