From pvanbuskirk at fsu.edu Thu Jul 9 13:21:01 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Thu Jul 9 13:21:09 2015 Subject: [FX.php List] Search Results To Text File Message-ID: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> Hi Group! Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? Example of how we need the results, "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. Any assistance would be greatly appreciated! Trish From mail at jsfmp.com Thu Jul 9 13:35:36 2015 From: mail at jsfmp.com (Joel Shapiro) Date: Thu Jul 9 13:35:45 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> Message-ID: Hi Trish Have a look at PHP's fputcsv function: http://php.net/manual/en/function.fputcsv.php HTH, -Joel On Jul 9, 2015, at 12:21 PM, VanBuskirk, Patricia wrote: > Hi Group! > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > Any assistance would be greatly appreciated! > > Trish > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From steve at bluecrocodile.co.nz Thu Jul 9 13:36:14 2015 From: steve at bluecrocodile.co.nz (Steve Winter) Date: Thu Jul 9 13:36:24 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> Message-ID: Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve > Hi Group! > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > Any assistance would be greatly appreciated! > > Trish > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz From pvanbuskirk at fsu.edu Thu Jul 9 13:54:39 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Thu Jul 9 13:54:51 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> Hi Steve (and Joel), We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. Thanks again for your responses! Trish -----Original Message----- From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 3:36 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve > Hi Group! > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > Any assistance would be greatly appreciated! > > Trish > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list From steve at bluecrocodile.co.nz Thu Jul 9 14:00:54 2015 From: steve at bluecrocodile.co.nz (Steve Winter) Date: Thu Jul 9 14:01:04 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> Message-ID: <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> Hi Patricia So - if you?re already using FX, then it should be pretty simple. In pseudo code create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) do a find for the records which need to be exported use http://php.net/manual/en/function.fopen.php to create a file resource feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested close the file using http://php.net/manual/en/function.fclose.php HTH Steve > Hi Steve (and Joel), > > We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). > > That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. > > Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. > > Thanks again for your responses! > > Trish > > > -----Original Message----- > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > Sent: Thursday, July 9, 2015 3:36 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia > > There are many different ways to solve this problem ;-) > > Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > Cheers > Steve > > >> Hi Group! >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> Example of how we need the results, >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> Any assistance would be greatly appreciated! >> >> Trish >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150709/e1973690/attachment.html From gfried at sonic.net Thu Jul 9 15:49:51 2015 From: gfried at sonic.net (Gary Frieders) Date: Thu Jul 9 15:49:59 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 1 In-Reply-To: <20150709195453.4C9E51B1773D@mail.iviking.org> References: <20150709195453.4C9E51B1773D@mail.iviking.org> Message-ID: <3853283F-CFF8-491B-83D4-A1C071E35180@sonic.net> Is there a version of FX.php that works with FMP 13 and/or 14? Thanks Gary Frieders > On Jul 9, 2015, at 12:54 PM, fx.php_list-request@mail.iviking.org wrote: > > Send FX.php_List mailing list submissions to > fx.php_list@mail.iviking.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.iviking.org/mailman/listinfo/fx.php_list > or, via email, send a message with subject or body 'help' to > fx.php_list-request@mail.iviking.org > > You can reach the person managing the list at > fx.php_list-owner@mail.iviking.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of FX.php_List digest..." > > > Today's Topics: > > 1. Re: [REMINDER] CWP User Group at DevCon 2015 (Bob Patin) > 2. Search Results To Text File (VanBuskirk, Patricia) > 3. Re: Search Results To Text File (Joel Shapiro) > 4. Re: Search Results To Text File (Steve Winter) > 5. RE: Search Results To Text File (VanBuskirk, Patricia) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 29 Jun 2015 16:10:19 -0500 > From: Bob Patin > Subject: Re: [FX.php List] [REMINDER] CWP User Group at DevCon 2015 > To: "FX.php Discussion List" > Message-ID: <2BDBDB76-8CCB-4666-A7EF-9921DFA50121@patin.com> > Content-Type: text/plain; charset=utf-8 > > You'll be missed, Chris; know that you'll be well-represented, at least programmatically if not vertically! > > (Chris is VERY tall)... > > > Bob Patin > Longterm Solutions > bob@longtermsolutions.com > 615-333-6858 > FileMaker 9, 10, 11, 12 & 13 Certified Developer > http://www.longtermsolutions.com > - > iChat: bobpatin@me.com > Twitter: bobpatin > ? > FileMaker Consulting > FileMaker Hosting for all versions of FileMaker > PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > >> On Jun 29, 2015, at 4:09 PM, Chris Hansen wrote: >> >> Thanks, but I won't be at DevCon this year. >> >> That said, the current changes won't affect your existing code, and they're still in the development branch (there's a pulldown for the desired branch on github.) I did just add a feature today -- all script-related functions functions (there are three) now have an optional second parameter for passing a script parameter to FileMaker. I would really like some feedback on whether people encounter problems with this development release, and ON THE DOCS. The Documentation directory can easily be opened without installing anything on your server -- it's just HTML/CSS/JS. I think it's a huge step up, but I'd really like some feedback from some impartial third parties. =) >> >> Next year, I AM hoping to be at DevCon. My plan is to have FX.php 7.1 ready by then (this will be a modernized version that requires a 5-something version of PHP.) I'll add some functionality, including configuration of object defaults via .ini files (no more having to tweak default values inside FX.php). >> >> Also next year, I'm planning to have my MVC framework ready. The view part of this framework is pure HTML -- i.e. NO embedded PHP in the files, AT ALL. (This means that even web browsers will render them beautifully.) I'm really excited about KeenMVC. >> >> Anyway, enjoy DevCon this year! >> >> Best, >> >> --Chris Hansen >> >>> On Jun 29, 2015, at 12:30 PM, Ness, David wrote: >>> >>> Perhaps we can have Chris Hansen fill this time with a description of his latest efforts he mentioned in his post of 6/22/2015 to this list. >>> >>> >>> David Ness >>> FileMaker & Web Applications Developer >>> >>> Bonded Builders Warranty Group >>> St. Petersburg, Florida USA >>> 800-749-0381 x4923 >>> >>> -----Original Message----- >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Joel Shapiro >>> Sent: Monday, June 29, 2015 2:09 PM >>> To: FX.php Discussion List >>> Subject: [FX.php List] [REMINDER] CWP User Group at DevCon 2015 >>> >>> Hi All >>> >>> Just a reminder that the CWP User Group is coming up -- three weeks from today(!) >>> >>> We may have an open spot so please let me know if you have anything you'd like to share. >>> >>> Monday, July 20 (keynote is Tues a.m.) >>> 4:00 - 6:00 p.m. >>> Room: Mont-Royal 2 >>> >>> Looking forward to seeing (some of) you soon! >>> >>> Best, >>> -Joel >>> >>> http://jsfmp.com/cwp-user-group >>> >>> _______________________________________________ >>> FX.php_List mailing list >>> FX.php_List@mail.iviking.org >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> _______________________________________________ >>> FX.php_List mailing list >>> FX.php_List@mail.iviking.org >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > > > ------------------------------ > > Message: 2 > Date: Thu, 9 Jul 2015 19:21:01 +0000 > From: "VanBuskirk, Patricia" > Subject: [FX.php List] Search Results To Text File > To: "FX.php_List@mail.iviking.org" > Message-ID: > <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> > Content-Type: text/plain; charset="us-ascii" > > Hi Group! > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > Any assistance would be greatly appreciated! > > Trish > > > ------------------------------ > > Message: 3 > Date: Thu, 9 Jul 2015 12:35:36 -0700 > From: Joel Shapiro > Subject: Re: [FX.php List] Search Results To Text File > To: "FX.php Discussion List" > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Hi Trish > > Have a look at PHP's fputcsv function: > > http://php.net/manual/en/function.fputcsv.php > > HTH, > -Joel > > > On Jul 9, 2015, at 12:21 PM, VanBuskirk, Patricia wrote: > >> Hi Group! >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> Example of how we need the results, >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> Any assistance would be greatly appreciated! >> >> Trish >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > > > ------------------------------ > > Message: 4 > Date: Thu, 9 Jul 2015 20:36:14 +0100 > From: Steve Winter > Subject: Re: [FX.php List] Search Results To Text File > To: "FX.php Discussion List" > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Hi Patricia > > There are many different ways to solve this problem ;-) > > Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > Cheers > Steve > > >> Hi Group! >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> Example of how we need the results, >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> Any assistance would be greatly appreciated! >> >> Trish >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > > > ------------------------------ > > Message: 5 > Date: Thu, 9 Jul 2015 19:54:39 +0000 > From: "VanBuskirk, Patricia" > Subject: RE: [FX.php List] Search Results To Text File > To: FX.php Discussion List > Message-ID: > <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> > Content-Type: text/plain; charset="utf-8" > > Hi Steve (and Joel), > > We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). > > That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. > > Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. > > Thanks again for your responses! > > Trish > > > -----Original Message----- > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > Sent: Thursday, July 9, 2015 3:36 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia > > There are many different ways to solve this problem ;-) > > Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > Cheers > Steve > > >> Hi Group! >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> Example of how we need the results, >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> Any assistance would be greatly appreciated! >> >> Trish >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > ------------------------------ > > _______________________________________________ > FX.php_List > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > End of FX.php_List Digest, Vol 129, Issue 1 > ******************************************* > From malcolm at notyourhomework.net Thu Jul 9 16:03:35 2015 From: malcolm at notyourhomework.net (Malcolm Fitzgerald) Date: Thu Jul 9 16:04:18 2015 Subject: [FX.php List] Re: FX for v13 / v14 In-Reply-To: <3853283F-CFF8-491B-83D4-A1C071E35180@sonic.net> References: <20150709195453.4C9E51B1773D@mail.iviking.org> <3853283F-CFF8-491B-83D4-A1C071E35180@sonic.net> Message-ID: <559EEFB7.7060703@notyourhomework.net> The current version, available from Github seems to be OK for v13/14. malcolm From pvanbuskirk at fsu.edu Thu Jul 9 17:28:53 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Thu Jul 9 17:29:25 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> Thanks, Steve! I will give this a shot tomorrow. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 4:01 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia So - if you?re already using FX, then it should be pretty simple. In pseudo code 1. create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) 2. do a find for the records which need to be exported 3. use http://php.net/manual/en/function.fopen.php to create a file resource 4. feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested 5. close the file using http://php.net/manual/en/function.fclose.php HTH Steve Hi Steve (and Joel), We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. Thanks again for your responses! Trish -----Original Message----- From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 3:36 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve Hi Group! Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? Example of how we need the results, "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. Any assistance would be greatly appreciated! Trish _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150709/e8d5708b/attachment.html From pvanbuskirk at fsu.edu Mon Jul 13 12:44:18 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Mon Jul 13 12:44:28 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 11538 bytes Desc: image001.png Url : http://mail.iviking.org/pipermail/fx.php_list/attachments/20150713/86dfe0b6/image001-0001.png From Kmohr at ncoesc.org Mon Jul 13 12:44:28 2015 From: Kmohr at ncoesc.org (Kathy Mohr) Date: Mon Jul 13 12:44:36 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 3 Message-ID: I will be out of the office the week of July 13. However, I will be monitoring email and the HQT courses. From beverlyvoth at gmail.com Mon Jul 13 13:11:35 2015 From: beverlyvoth at gmail.com (BEVERLY VOTH) Date: Mon Jul 13 13:11:43 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> Message-ID: <43CB1DE5-CC4F-4741-A002-60254A91A5DE@gmail.com> this is the page for fputcsv(): http://php.net/manual/en/function.fputcsv.php (as Steve W. pointed out) There are some work-arounds for older versions of PHP (especially #7 from ifunk). Sometimes a function works in a version and sometimes not. What version of PHP is running? You can use phpinfo() to find out. you are getting something, so that's a clue perhaps? Beverly On Jul 13, 2015, at 2:44 PM, VanBuskirk, Patricia wrote: > Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: > > "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" > "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" > "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" > > Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150713/7c84d3d7/attachment.html From beverlyvoth at gmail.com Mon Jul 13 13:16:07 2015 From: beverlyvoth at gmail.com (BEVERLY VOTH) Date: Mon Jul 13 13:16:14 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> Message-ID: <332AE95A-EF35-4438-BF63-EB496FB3FCCC@gmail.com> Also, you don't need to assign the variables, just push the values On Jul 13, 2015, at 2:44 PM, VanBuskirk, Patricia wrote: > $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); > fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp, $linearray, ',', '"' ) . "\l" ; Beverly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150713/f3b10b8c/attachment.html From pvanbuskirk at fsu.edu Mon Jul 13 13:22:31 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Mon Jul 13 13:22:39 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <332AE95A-EF35-4438-BF63-EB496FB3FCCC@gmail.com> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> <332AE95A-EF35-4438-BF63-EB496FB3FCCC@gmail.com> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C464115@fsu-exch-nwr03.fsu.edu> Thanks Bev, I was using that page to attempt the fputcsv function, in every possible way I could imagine and just can't get the result I wanted. As you can see, I haven't worked with FX or Filemaker.php in a long time. I am having to wrap my mind around it again after about 6 years away. Trish From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of BEVERLY VOTH Sent: Monday, July 13, 2015 3:16 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Also, you don't need to assign the variables, just push the values On Jul 13, 2015, at 2:44 PM, VanBuskirk, Patricia > wrote: $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp, $linearray, ',', '"' ) . "\l" ; Beverly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150713/ca9dc47e/attachment-0001.html From malcolm at notyourhomework.net Mon Jul 13 13:46:00 2015 From: malcolm at notyourhomework.net (Malcolm Fitzgerald) Date: Mon Jul 13 13:46:13 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> Message-ID: <55A41578.3040005@notyourhomework.net> Hi Patricia, Are you absolutely sure that every field MUST have double quotes around it? The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? Malcolm On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: > > Hi guys, I think I?m really close. I?m getting it to create the file, > but I am struggling with the format. Each field needs to have double > quotes around it, as in the following example: > > "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A > (MMA) - 969 LEARNING > WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" > > "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY > CENTER - BLDG. A (UCA) - 282 CHAMPIONS > WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" > > "FSU01","TSR0299915","Medicine College of Dean's Office - COM > -THRASHER BLDG. 1115 W CALL > ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" > > Here?s how it?s coming out now. It is putting a little square when > the carriage return should be, and the fields are not being surrounded > by quotation marks. I tried using the $delimiter and $enclosure > parameters, but they put random quotation marks in (maybe just around > text fields?). I can get it to echo to the page properly, by using ? > ???.$field1.??,??.field2 ? etc. > > Here?s my code: > > > define('DEBUG', TRUE); > > require_once('FX.php'); > > require_once('server_data.php'); > > require_once('FMErrors.php'); > > $search=new FX(FM_IP, FM_PORT, FM_VERSION); > > $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); > > $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); > > $search->AddDBParam('Status_CD', 'OPEN'); > > $search->AddDBParam('ExportTimestamp', null); > > $search->AddDBParam('REQ_Start_Dt', ' * '); > > $search->AddDBParam('REQ_End_Dt', ' * '); > > $search->AddDBParam('Descr254', ' * '); > > $searchResult = $search->DoFXAction('perform_find'); > > $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); > > echo "
Found Records: ".count($searchResult)."
"; > > foreach ($searchResult as $record) { > > $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); > > fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' > )."\l" ; > > } > > fclose($fp); > > echo("
Error Code: {$search->lastErrorCode}
"); > > echo("FileMaker Error Message: > {$errorsList[$search->lastErrorCode]}

"); > > echo "Error: ".$searchResult['errorCode']; > > ?> > > I have been messing with this darn thing for several days now, so any > tips or direction given will be greatly appreciated! > > Trish > > *From:*fx.php_list-bounces@mail.iviking.org > > [mailto:fx.php_list-bounces@mail.iviking.org] *On Behalf Of *Steve Winter > *Sent:* Thursday, July 9, 2015 4:01 PM > *To:* FX.php Discussion List > *Subject:* Re: [FX.php List] Search Results To Text File > > Hi Patricia > > So - if you?re already using FX, then it should be pretty simple. In > pseudo code > > 1. create a brand new layout and place the fields you need to export, > in the order you need to export them on that layout from top to > bottom (this may sounds mad, but what it will mean is that when > the FX array of records comes back the fields will be in the right > order) > 2. do a find for the records which need to be exported > 3. use http://php.net/manual/en/function.fopen.php to create a file > resource > 4. feed the file resource and the FX array of returned records into > http://php.net/manual/en/function.fputcsv.php which Joel suggested > 5. close the file using http://php.net/manual/en/function.fclose.php > > HTH > > Steve > > Hi Steve (and Joel), > > We are currently using FMS 11Adv, but have plans to upgrade to 14 > as soon as budget is approved (as fast a herd of turtles around here). > > That robot has been in use using a script running plug-in for > years, importing orders from the web, then creating a csv of > certain info for our PeopleSoft folks to import into their > inventory system (which is why ODBC is not an option). They have > very specific formatting that they must have or their import will > fail. > > Anywho.... I have replaced the import portion of it through FX, > but haven?t yet figured out how to do the export part. > > Thanks again for your responses! > > Trish > > > -----Original Message----- > From: fx.php_list-bounces@mail.iviking.org > > [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve > Winter > Sent: Thursday, July 9, 2015 3:36 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia > > There are many different ways to solve this problem ;-) > > Which version of FM server are you using?? it?s certainly possible > with both 13 and 14 to export records to csv with a server-side > script, so this is going to be the simplest way to go about it. > > Otherwise either FX or the PHP API could also be used with a > scheduled task. > > Cheers > Steve > > > Hi Group! > > Is there a way, using fx.php to create a csv text file of > search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - > ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - > ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - > ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - > ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file > every 1/2 hour within a FM client. We are trying to get rid > of that FM installation and automate it through php. I was > actually trying to run a FM script through FM Server, but it > seems export is not a permitted script step for server script > scheduling. > > Any assistance would be greatly appreciated! > > Trish > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > > +44 777 852 4776 > > steve@bluecrocodile.co.nz > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- Skipped content of type multipart/related From pvanbuskirk at fsu.edu Mon Jul 13 13:53:06 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Mon Jul 13 13:53:20 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <55A41578.3040005@notyourhomework.net> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> <55A41578.3040005@notyourhomework.net> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C464270@fsu-exch-nwr03.fsu.edu> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 11538 bytes Desc: image001.png Url : http://mail.iviking.org/pipermail/fx.php_list/attachments/20150713/9d25f902/image001-0001.png From dale.bengston at gmail.com Mon Jul 13 14:37:31 2015 From: dale.bengston at gmail.com (Dale Bengston) Date: Mon Jul 13 14:37:41 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C464270@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> <55A41578.3040005@notyourhomework.net> <7731A5AA5FC88D48831221524FB9D8901C464270@fsu-exch-nwr03.fsu.edu> Message-ID: <73E8EF37-67C7-40CF-B732-4FBD06202A5D@gmail.com> Hi Trish, If your fields are in the same order coming off your FileMaker layout as you?d like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: foreach ($searchResult as $record) { $line = ??? . implode(??,??, $record) . ??? . ?\n?; fwrite($fp, $line); } My email probably made those double quotes into typesetting quotes, so you?ll probably have to put them back to straight quotes if you copy from here. Just a thought. Dale > On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: > > Unfortunately, yes. It is being FTP?d to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the ?golden? program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald > Sent: Monday, July 13, 2015 3:46 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia, > > Are you absolutely sure that every field MUST have double quotes around it? > > The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? > > Malcolm > > > > On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: > Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: > > "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" > "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" > "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" > > Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. > > > > Here?s my code: > > > define('DEBUG', TRUE); > require_once('FX.php'); > require_once('server_data.php'); > require_once('FMErrors.php'); > > > $search=new FX(FM_IP, FM_PORT, FM_VERSION); > $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); > $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); > $search->AddDBParam('Status_CD', 'OPEN'); > $search->AddDBParam('ExportTimestamp', null); > $search->AddDBParam('REQ_Start_Dt', ' * '); > $search->AddDBParam('REQ_End_Dt', ' * '); > $search->AddDBParam('Descr254', ' * '); > $searchResult = $search->DoFXAction('perform_find'); > > $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); > > echo "
Found Records: ".count($searchResult)."
"; > > foreach ($searchResult as $record) { > > $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); > fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; > } > fclose($fp); > > echo("
Error Code: {$search->lastErrorCode}
"); > echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); > echo "Error: ".$searchResult['errorCode']; > > ?> > > I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! > > Trish > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > Sent: Thursday, July 9, 2015 4:01 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia > > So - if you?re already using FX, then it should be pretty simple. In pseudo code > > ? create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) > ? do a find for the records which need to be exported > ? use http://php.net/manual/en/function.fopen.php to create a file resource > ? feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested > ? close the file using http://php.net/manual/en/function.fclose.php > > HTH > Steve > > > > > Hi Steve (and Joel), > > We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). > > That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. > > Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. > > Thanks again for your responses! > > Trish > > > -----Original Message----- > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > Sent: Thursday, July 9, 2015 3:36 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > Hi Patricia > > There are many different ways to solve this problem ;-) > > Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > Cheers > Steve > > > > > Hi Group! > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > Example of how we need the results, > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > Any assistance would be greatly appreciated! > > Trish > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > Steve Winter > +44 777 852 4776 > steve@bluecrocodile.co.nz > > > > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From malcolm at notyourhomework.net Mon Jul 13 15:59:07 2015 From: malcolm at notyourhomework.net (Malcolm Fitzgerald) Date: Mon Jul 13 15:59:22 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <73E8EF37-67C7-40CF-B732-4FBD06202A5D@gmail.com> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> <55A41578.3040005@notyourhomework.net> <7731A5AA5FC88D48831221524FB9D8901C464270@fsu-exch-nwr03.fsu.edu> <73E8EF37-67C7-40CF-B732-4FBD06202A5D@gmail.com> Message-ID: <55A434AB.4020404@notyourhomework.net> There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. |function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { # Check if $fields is an array if (!is_array($fields)) { return false; } # Walk through the data array for ($i = 0, $n = count($fields); $i < $n; $i ++) { # Duplicate in-value $enclosure's and put the value in $enclosure's $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; } # Combine the data array with $delimiter and write it to the file $line = implode($delimiter, $fields) . PHP_EOL ; fwrite($handle, $line); # Return the length of the written data return strlen($line); }| Malcolm On 14/07/2015 8:37 am, Dale Bengston wrote: > Hi Trish, > > If your fields are in the same order coming off your FileMaker layout as you?d like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: > > foreach ($searchResult as $record) { > $line = ??? . implode(??,??, $record) . ??? . ?\n?; > fwrite($fp, $line); > } > > My email probably made those double quotes into typesetting quotes, so you?ll probably have to put them back to straight quotes if you copy from here. > > Just a thought. > > Dale > >> On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: >> >> Unfortunately, yes. It is being FTP?d to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the ?golden? program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >> Sent: Monday, July 13, 2015 3:46 PM >> To: FX.php Discussion List >> Subject: Re: [FX.php List] Search Results To Text File >> >> Hi Patricia, >> >> Are you absolutely sure that every field MUST have double quotes around it? >> >> The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? >> >> Malcolm >> >> >> >> On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: >> Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: >> >> "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" >> "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" >> "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" >> >> Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. >> >> >> >> Here?s my code: >> >> > >> define('DEBUG', TRUE); >> require_once('FX.php'); >> require_once('server_data.php'); >> require_once('FMErrors.php'); >> >> >> $search=new FX(FM_IP, FM_PORT, FM_VERSION); >> $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); >> $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); >> $search->AddDBParam('Status_CD', 'OPEN'); >> $search->AddDBParam('ExportTimestamp', null); >> $search->AddDBParam('REQ_Start_Dt', ' * '); >> $search->AddDBParam('REQ_End_Dt', ' * '); >> $search->AddDBParam('Descr254', ' * '); >> $searchResult = $search->DoFXAction('perform_find'); >> >> $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); >> >> echo "
Found Records: ".count($searchResult)."
"; >> >> foreach ($searchResult as $record) { >> >> $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); >> fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; >> } >> fclose($fp); >> >> echo("
Error Code: {$search->lastErrorCode}
"); >> echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); >> echo "Error: ".$searchResult['errorCode']; >> >> ?> >> >> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! >> >> Trish >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >> Sent: Thursday, July 9, 2015 4:01 PM >> To: FX.php Discussion List >> Subject: Re: [FX.php List] Search Results To Text File >> >> Hi Patricia >> >> So - if you?re already using FX, then it should be pretty simple. In pseudo code >> >> ? create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) >> ? do a find for the records which need to be exported >> ? use http://php.net/manual/en/function.fopen.php to create a file resource >> ? feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested >> ? close the file using http://php.net/manual/en/function.fclose.php >> >> HTH >> Steve >> >> >> >> >> Hi Steve (and Joel), >> >> We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). >> >> That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. >> >> Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. >> >> Thanks again for your responses! >> >> Trish >> >> >> -----Original Message----- >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >> Sent: Thursday, July 9, 2015 3:36 PM >> To: FX.php Discussion List >> Subject: Re: [FX.php List] Search Results To Text File >> >> Hi Patricia >> >> There are many different ways to solve this problem ;-) >> >> Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. >> >> Otherwise either FX or the PHP API could also be used with a scheduled task. >> >> Cheers >> Steve >> >> >> >> >> Hi Group! >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> Example of how we need the results, >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> Any assistance would be greatly appreciated! >> >> Trish >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> Steve Winter >> +44 777 852 4776 >> steve@bluecrocodile.co.nz >> >> >> >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> Steve Winter >> +44 777 852 4776 >> steve@bluecrocodile.co.nz >> >> >> >> >> >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150714/38b90053/attachment-0001.html From pvanbuskirk at fsu.edu Tue Jul 14 05:41:04 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Tue Jul 14 05:41:13 2015 Subject: [FX.php List] Search Results To Text File In-Reply-To: <55A434AB.4020404@notyourhomework.net> References: <7731A5AA5FC88D48831221524FB9D8901C460E1D@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C460F10@fsu-exch-nwr03.fsu.edu> <22C20FFC-3331-4B65-8678-02F76412D020@bluecrocodile.co.nz> <7731A5AA5FC88D48831221524FB9D8901C4612EF@fsu-exch-nwr03.fsu.edu> <7731A5AA5FC88D48831221524FB9D8901C463FAA@fsu-exch-nwr03.fsu.edu> <55A41578.3040005@notyourhomework.net> <7731A5AA5FC88D48831221524FB9D8901C464270@fsu-exch-nwr03.fsu.edu> <73E8EF37-67C7-40CF-B732-4FBD06202A5D@gmail.com> <55A434AB.4020404@notyourhomework.net> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C46483A@fsu-exch-nwr03.fsu.edu> Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I?ll let the group know what ends up working. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 5:59 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { # Check if $fields is an array if (!is_array($fields)) { return false; } # Walk through the data array for ($i = 0, $n = count($fields); $i < $n; $i ++) { # Duplicate in-value $enclosure's and put the value in $enclosure's $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; } # Combine the data array with $delimiter and write it to the file $line = implode($delimiter, $fields) . PHP_EOL ; fwrite($handle, $line); # Return the length of the written data return strlen($line); } Malcolm On 14/07/2015 8:37 am, Dale Bengston wrote: Hi Trish, If your fields are in the same order coming off your FileMaker layout as you?d like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: foreach ($searchResult as $record) { $line = ??? . implode(??,??, $record) . ??? . ?\n?; fwrite($fp, $line); } My email probably made those double quotes into typesetting quotes, so you?ll probably have to put them back to straight quotes if you copy from here. Just a thought. Dale On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: Unfortunately, yes. It is being FTP?d to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the ?golden? program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 3:46 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia, Are you absolutely sure that every field MUST have double quotes around it? The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? Malcolm On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. Here?s my code: SetDBData('WorkOrders_TST.fp7','SeeALL'); $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); $search->AddDBParam('Status_CD', 'OPEN'); $search->AddDBParam('ExportTimestamp', null); $search->AddDBParam('REQ_Start_Dt', ' * '); $search->AddDBParam('REQ_End_Dt', ' * '); $search->AddDBParam('Descr254', ' * '); $searchResult = $search->DoFXAction('perform_find'); $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); echo "
Found Records: ".count($searchResult)."
"; foreach ($searchResult as $record) { $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; } fclose($fp); echo("
Error Code: {$search->lastErrorCode}
"); echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); echo "Error: ".$searchResult['errorCode']; ?> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! Trish From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 4:01 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia So - if you?re already using FX, then it should be pretty simple. In pseudo code ? create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) ? do a find for the records which need to be exported ? use http://php.net/manual/en/function.fopen.php to create a file resource ? feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested ? close the file using http://php.net/manual/en/function.fclose.php HTH Steve Hi Steve (and Joel), We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. Thanks again for your responses! Trish -----Original Message----- From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 3:36 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve Hi Group! Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? Example of how we need the results, "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. Any assistance would be greatly appreciated! Trish _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150714/605d367a/attachment-0001.html From Kmohr at ncoesc.org Tue Jul 14 05:41:43 2015 From: Kmohr at ncoesc.org (Kathy Mohr) Date: Tue Jul 14 05:41:54 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 8 Message-ID: I will be out of the office the week of July 13. However, I will be monitoring email and the HQT courses. From dness at bondedbuilders.com Tue Jul 14 07:08:27 2015 From: dness at bondedbuilders.com (Ness, David) Date: Tue Jul 14 07:08:34 2015 Subject: [FX.php List] Finding match to an email address Message-ID: What is the best approach for attempting to search for an email address entered on the website within FileMaker using fx.PHP? I currently trim, lower, and replace '@', '*', and "!" on both ends and search on those results for a match. Not that it's likely, but this would result in both of these leading to a match. abc@def.com == ab@cdef.com Is there a better way that you use? David Ness FileMaker & Web Applications Developer Bonded Builders Warranty Group St. Petersburg, Florida USA 800-749-0381 x4923 From bob at patin.com Tue Jul 14 07:22:41 2015 From: bob at patin.com (Bob Patin) Date: Tue Jul 14 07:22:46 2015 Subject: [FX.php List] Finding match to an email address In-Reply-To: References: Message-ID: <8C987F62-6783-4AD5-A561-B5170E9FA365@patin.com> Try this: $q->AddDBParam('email','=='.preg_replace('/([@*#?!=<>"])/','\\\${1}',$email)); Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > On Jul 14, 2015, at 8:08 AM, Ness, David wrote: > > What is the best approach for attempting to search for an email address entered on the website within FileMaker using fx.PHP? > > I currently trim, lower, and replace '@', '*', and "!" on both ends and search on those results for a match. > > Not that it's likely, but this would result in both of these leading to a match. > > abc@def.com == ab@cdef.com > > Is there a better way that you use? > > > David Ness > FileMaker & Web Applications Developer > > Bonded Builders Warranty Group > St. Petersburg, Florida USA > 800-749-0381 x4923 > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From dness at bondedbuilders.com Tue Jul 14 08:03:29 2015 From: dness at bondedbuilders.com (Ness, David) Date: Tue Jul 14 08:03:35 2015 Subject: [FX.php List] Finding match to an email address In-Reply-To: <8C987F62-6783-4AD5-A561-B5170E9FA365@patin.com> References: <8C987F62-6783-4AD5-A561-B5170E9FA365@patin.com> Message-ID: Thanks Bob, Yes, that seems to work perfectly. See you next week, buddy. David Ness FileMaker & Web Applications Developer Bonded Builders Warranty Group St. Petersburg, Florida USA 800-749-0381 x4923 -----Original Message----- Try this: $q->AddDBParam('email','=='.preg_replace('/([@*#?!=<>"])/','\\\${1}',$email)); Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > On Jul 14, 2015, at 8:08 AM, Ness, David wrote: > > What is the best approach for attempting to search for an email address entered on the website within FileMaker using fx.PHP? > > I currently trim, lower, and replace '@', '*', and "!" on both ends and search on those results for a match. > > Not that it's likely, but this would result in both of these leading to a match. > > abc@def.com == ab@cdef.com > > Is there a better way that you use? > > > David Ness > FileMaker & Web Applications Developer > > Bonded Builders Warranty Group > St. Petersburg, Florida USA > 800-749-0381 x4923 From bob at patin.com Tue Jul 14 08:17:42 2015 From: bob at patin.com (Bob Patin) Date: Tue Jul 14 08:17:46 2015 Subject: [FX.php List] Finding match to an email address In-Reply-To: References: <8C987F62-6783-4AD5-A561-B5170E9FA365@patin.com> Message-ID: Absolutely! I don't think I'll be in Las Vegas in time for Joel's unconference, but I'm sure we'll run into each other. All the best, Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > On Jul 14, 2015, at 9:03 AM, Ness, David wrote: > > Thanks Bob, > > Yes, that seems to work perfectly. > > See you next week, buddy. > > > David Ness > FileMaker & Web Applications Developer > > Bonded Builders Warranty Group > St. Petersburg, Florida USA > 800-749-0381 x4923 > > > -----Original Message----- > > Try this: > > $q->AddDBParam('email','=='.preg_replace('/([@*#?!=<>"])/','\\\${1}',$email)); > > > Bob Patin > Longterm Solutions > bob@longtermsolutions.com > 615-333-6858 > FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com > - > iChat: bobpatin@me.com > Twitter: bobpatin > ? > FileMaker Consulting > FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > >> On Jul 14, 2015, at 8:08 AM, Ness, David wrote: >> >> What is the best approach for attempting to search for an email address entered on the website within FileMaker using fx.PHP? >> >> I currently trim, lower, and replace '@', '*', and "!" on both ends and search on those results for a match. >> >> Not that it's likely, but this would result in both of these leading to a match. >> >> abc@def.com == ab@cdef.com >> >> Is there a better way that you use? >> >> >> David Ness >> FileMaker & Web Applications Developer >> >> Bonded Builders Warranty Group >> St. Petersburg, Florida USA >> 800-749-0381 x4923 > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From pvanbuskirk at fsu.edu Tue Jul 14 08:44:04 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Tue Jul 14 08:44:22 2015 Subject: [FX.php List] Search Results To Text File -- SOLVED! Message-ID: <7731A5AA5FC88D48831221524FB9D8901C465012@fsu-exch-nwr03.fsu.edu> So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. FM field ( named cf_lineForExport ) : "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" PHP code : $fp = 'C:\\Temp\\NewOMNI.txt'; echo "
Found Records: ".count($searchResult)."
"; foreach ($searchResult as $record) { $line .= $record['cf_lineForExport']."\r\n" ; file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); } fclose($fp); Comes out perfectly! Thanks again for all the tips and ideas! Trish V. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia Sent: Tuesday, July 14, 2015 7:41 AM To: FX.php Discussion List Subject: RE: [FX.php List] Search Results To Text File Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I?ll let the group know what ends up working. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 5:59 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { # Check if $fields is an array if (!is_array($fields)) { return false; } # Walk through the data array for ($i = 0, $n = count($fields); $i < $n; $i ++) { # Duplicate in-value $enclosure's and put the value in $enclosure's $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; } # Combine the data array with $delimiter and write it to the file $line = implode($delimiter, $fields) . PHP_EOL ; fwrite($handle, $line); # Return the length of the written data return strlen($line); } Malcolm On 14/07/2015 8:37 am, Dale Bengston wrote: Hi Trish, If your fields are in the same order coming off your FileMaker layout as you?d like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: foreach ($searchResult as $record) { $line = ??? . implode(??,??, $record) . ??? . ?\n?; fwrite($fp, $line); } My email probably made those double quotes into typesetting quotes, so you?ll probably have to put them back to straight quotes if you copy from here. Just a thought. Dale On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: Unfortunately, yes. It is being FTP?d to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the ?golden? program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 3:46 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia, Are you absolutely sure that every field MUST have double quotes around it? The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? Malcolm On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. Here?s my code: SetDBData('WorkOrders_TST.fp7','SeeALL'); $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); $search->AddDBParam('Status_CD', 'OPEN'); $search->AddDBParam('ExportTimestamp', null); $search->AddDBParam('REQ_Start_Dt', ' * '); $search->AddDBParam('REQ_End_Dt', ' * '); $search->AddDBParam('Descr254', ' * '); $searchResult = $search->DoFXAction('perform_find'); $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); echo "
Found Records: ".count($searchResult)."
"; foreach ($searchResult as $record) { $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; } fclose($fp); echo("
Error Code: {$search->lastErrorCode}
"); echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); echo "Error: ".$searchResult['errorCode']; ?> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! Trish From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 4:01 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia So - if you?re already using FX, then it should be pretty simple. In pseudo code ? create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) ? do a find for the records which need to be exported ? use http://php.net/manual/en/function.fopen.php to create a file resource ? feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested ? close the file using http://php.net/manual/en/function.fclose.php HTH Steve Hi Steve (and Joel), We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. Thanks again for your responses! Trish -----Original Message----- From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 3:36 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve Hi Group! Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? Example of how we need the results, "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. Any assistance would be greatly appreciated! Trish _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150714/498f0ea3/attachment-0001.html From malcolm at notyourhomework.net Tue Jul 14 16:08:52 2015 From: malcolm at notyourhomework.net (Malcolm Fitzgerald) Date: Tue Jul 14 16:09:29 2015 Subject: [FX.php List] Search Results To Text File -- SOLVED! In-Reply-To: <7731A5AA5FC88D48831221524FB9D8901C465012@fsu-exch-nwr03.fsu.edu> References: <7731A5AA5FC88D48831221524FB9D8901C465012@fsu-exch-nwr03.fsu.edu> Message-ID: <55A58874.8090603@notyourhomework.net> Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. let ( row = List ( quote( Business_Unit ) ; quote ( WO_ID ) ; quote ( Descr254 ) ; ... ) ; substitute ( row ; ? ; "," ) ) On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: > > So, I was able to get it to work by creating a calculated field in the > database that created the line of formatted info I needed for the > export. Then, I used the fwrite function. > > FM field ( named cf_lineForExport ) : > > "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" > & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & > Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & > > Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day > ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & > > Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( > REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" > > PHP code : > > $fp = 'C:\\Temp\\NewOMNI.txt'; > > echo "
Found Records: ".count($searchResult)."
"; > > foreach ($searchResult as $record) { > > $line .= $record['cf_lineForExport']."\r\n" ; > > file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); > > } > > fclose($fp); > > Comes out perfectly! Thanks again for all the tips and ideas! > > Trish V. > > *From:*fx.php_list-bounces@mail.iviking.org > [mailto:fx.php_list-bounces@mail.iviking.org] *On Behalf Of > *VanBuskirk, Patricia > *Sent:* Tuesday, July 14, 2015 7:41 AM > *To:* FX.php Discussion List > *Subject:* RE: [FX.php List] Search Results To Text File > > Thanks Malcolm and Dale! I will check out your suggestions today. I > truly appreciate the help! I?ll let the group know what ends up working. > > *From:*fx.php_list-bounces@mail.iviking.org > > [mailto:fx.php_list-bounces@mail.iviking.org] *On Behalf Of *Malcolm > Fitzgerald > *Sent:* Monday, July 13, 2015 5:59 PM > *To:* FX.php Discussion List > *Subject:* Re: [FX.php List] Search Results To Text File > > There are two other considerations. First, you must escape your field > delimiters if they occur within the data. Second, what are the rules > concerned your record delimiter, if it appears within the data. Lots > of import programs give record delimiters a higher priority than field > delimiters causing all sorts of mess. > > This function was amongst the comments on the fputcsv page at php.net. > I modified it slightly, the original by R dot Mansveld at Spider-IT > dot de, didn't quote numerals. > > function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { > # Check if $fields is an array > if (!is_array($fields)) { > return false; > } > # Walk through the data array > for ($i = 0, $n = count($fields); $i < $n; $i ++) { > # Duplicate in-value $enclosure's and put the value in > $enclosure's > $fields[$i] = $enclosure . str_replace($enclosure, > $enclosure . $enclosure, $fields[$i]) . $enclosure; > } > # Combine the data array with $delimiter and write it to the file > $line = implode($delimiter, $fields) . PHP_EOL ; > fwrite($handle, $line); > > # Return the length of the written data > return strlen($line); > } > > Malcolm > > On 14/07/2015 8:37 am, Dale Bengston wrote: > > Hi Trish, > > > > If your fields are in the same order coming off your FileMaker layout as you?d like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: > > > > foreach ($searchResult as $record) { > > $line = ??? . implode(??,??, $record) . ??? . ?\n?; > > fwrite($fp, $line); > > } > > > > My email probably made those double quotes into typesetting quotes, so you?ll probably have to put them back to straight quotes if you copy from here. > > > > Just a thought. > > > > Dale > > > > On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: > > > > Unfortunately, yes. It is being FTP?d to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the ?golden? program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. > > > > > > From:fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald > > Sent: Monday, July 13, 2015 3:46 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia, > > > > Are you absolutely sure that every field MUST have double quotes around it? > > > > The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? > > > > Malcolm > > > > > > > > On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: > > Hi guys, I think I?m really close. I?m getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: > > > > "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" > > "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" > > "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" > > > > Here?s how it?s coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ? ???.$field1.??,??.field2 ? etc. > > > > > > > > Here?s my code: > > > > > > > define('DEBUG', TRUE); > > require_once('FX.php'); > > require_once('server_data.php'); > > require_once('FMErrors.php'); > > > > > > $search=new FX(FM_IP, FM_PORT, FM_VERSION); > > $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); > > $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); > > $search->AddDBParam('Status_CD', 'OPEN'); > > $search->AddDBParam('ExportTimestamp', null); > > $search->AddDBParam('REQ_Start_Dt', ' * '); > > $search->AddDBParam('REQ_End_Dt', ' * '); > > $search->AddDBParam('Descr254', ' * '); > > $searchResult = $search->DoFXAction('perform_find'); > > > > $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); > > > > echo "
Found Records: ".count($searchResult)."
"; > > > > foreach ($searchResult as $record) { > > > > $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); > > fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; > > } > > fclose($fp); > > > > echo("
Error Code: {$search->lastErrorCode}
"); > > echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); > > echo "Error: ".$searchResult['errorCode']; > > > > ?> > > > > I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! > > > > Trish > > > > > > From:fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > > Sent: Thursday, July 9, 2015 4:01 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia > > > > So - if you?re already using FX, then it should be pretty simple. In pseudo code > > > > ? create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) > > ? do a find for the records which need to be exported > > ? usehttp://php.net/manual/en/function.fopen.php to create a file resource > > ? feed the file resource and the FX array of returned records intohttp://php.net/manual/en/function.fputcsv.php which Joel suggested > > ? close the file usinghttp://php.net/manual/en/function.fclose.php > > > > HTH > > Steve > > > > > > > > > > Hi Steve (and Joel), > > > > We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). > > > > That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. > > > > Anywho.... I have replaced the import portion of it through FX, but haven?t yet figured out how to do the export part. > > > > Thanks again for your responses! > > > > Trish > > > > > > -----Original Message----- > > From:fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > > Sent: Thursday, July 9, 2015 3:36 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia > > > > There are many different ways to solve this problem ;-) > > > > Which version of FM server are you using?? it?s certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > > > Cheers > > Steve > > > > > > > > > > Hi Group! > > > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > > > Example of how we need the results, > > > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > > > Any assistance would be greatly appreciated! > > > > Trish > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > Steve Winter > > +44 777 852 4776 > > steve@bluecrocodile.co.nz > > > > > > > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > Steve Winter > > +44 777 852 4776 > > steve@bluecrocodile.co.nz > > > > > > > > > > > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/d7c12caf/attachment-0001.html From pvanbuskirk at fsu.edu Wed Jul 15 08:40:07 2015 From: pvanbuskirk at fsu.edu (VanBuskirk, Patricia) Date: Wed Jul 15 08:40:28 2015 Subject: [FX.php List] Search Results To Text File -- SOLVED! In-Reply-To: <55A58874.8090603@notyourhomework.net> References: <7731A5AA5FC88D48831221524FB9D8901C465012@fsu-exch-nwr03.fsu.edu> <55A58874.8090603@notyourhomework.net> Message-ID: <7731A5AA5FC88D48831221524FB9D8901C466481@fsu-exch-nwr03.fsu.edu> That looks MUCH better! Thanks, Malcolm! p.s. Using FM11 now, but converting to 14 soon. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Tuesday, July 14, 2015 6:09 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File -- SOLVED! Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. let ( row = List ( quote( Business_Unit ) ; quote ( WO_ID ) ; quote ( Descr254 ) ; ... ) ; substitute ( row ; ? ; "," ) ) On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. FM field ( named cf_lineForExport ) : "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" PHP code : $fp = 'C:\\Temp\\NewOMNI.txt'; echo "
Found Records: ".count($searchResult)."
"; foreach ($searchResult as $record) { $line .= $record['cf_lineForExport']."\r\n" ; file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); } fclose($fp); Comes out perfectly! Thanks again for all the tips and ideas! Trish V. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia Sent: Tuesday, July 14, 2015 7:41 AM To: FX.php Discussion List Subject: RE: [FX.php List] Search Results To Text File Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I'll let the group know what ends up working. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 5:59 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { # Check if $fields is an array if (!is_array($fields)) { return false; } # Walk through the data array for ($i = 0, $n = count($fields); $i < $n; $i ++) { # Duplicate in-value $enclosure's and put the value in $enclosure's $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; } # Combine the data array with $delimiter and write it to the file $line = implode($delimiter, $fields) . PHP_EOL ; fwrite($handle, $line); # Return the length of the written data return strlen($line); } Malcolm On 14/07/2015 8:37 am, Dale Bengston wrote: Hi Trish, If your fields are in the same order coming off your FileMaker layout as you'd like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: foreach ($searchResult as $record) { $line = '"' . implode('","', $record) . '"' . "\n"; fwrite($fp, $line); } My email probably made those double quotes into typesetting quotes, so you'll probably have to put them back to straight quotes if you copy from here. Just a thought. Dale On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: Unfortunately, yes. It is being FTP'd to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the "golden" program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald Sent: Monday, July 13, 2015 3:46 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia, Are you absolutely sure that every field MUST have double quotes around it? The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? Malcolm On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: Hi guys, I think I'm really close. I'm getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" Here's how it's coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ... '"'.$field1.'","'.field2 ... etc. Here's my code: SetDBData('WorkOrders_TST.fp7','SeeALL'); $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); $search->AddDBParam('Status_CD', 'OPEN'); $search->AddDBParam('ExportTimestamp', null); $search->AddDBParam('REQ_Start_Dt', ' * '); $search->AddDBParam('REQ_End_Dt', ' * '); $search->AddDBParam('Descr254', ' * '); $searchResult = $search->DoFXAction('perform_find'); $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); echo "
Found Records: ".count($searchResult)."
"; foreach ($searchResult as $record) { $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; } fclose($fp); echo("
Error Code: {$search->lastErrorCode}
"); echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); echo "Error: ".$searchResult['errorCode']; ?> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! Trish From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 4:01 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia So - if you're already using FX, then it should be pretty simple. In pseudo code * create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) * do a find for the records which need to be exported * use http://php.net/manual/en/function.fopen.php to create a file resource * feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested * close the file using http://php.net/manual/en/function.fclose.php HTH Steve Hi Steve (and Joel), We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. Anywho.... I have replaced the import portion of it through FX, but haven't yet figured out how to do the export part. Thanks again for your responses! Trish -----Original Message----- From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter Sent: Thursday, July 9, 2015 3:36 PM To: FX.php Discussion List Subject: Re: [FX.php List] Search Results To Text File Hi Patricia There are many different ways to solve this problem ;-) Which version of FM server are you using...? it's certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. Otherwise either FX or the PHP API could also be used with a scheduled task. Cheers Steve Hi Group! Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? Example of how we need the results, "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. Any assistance would be greatly appreciated! Trish _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list Steve Winter +44 777 852 4776 steve@bluecrocodile.co.nz _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/57751a8b/attachment-0001.html From Kmohr at ncoesc.org Wed Jul 15 08:40:28 2015 From: Kmohr at ncoesc.org (Kathy Mohr) Date: Wed Jul 15 08:40:40 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 11 Message-ID: I will be out of the office the week of July 13. However, I will be monitoring email and the HQT courses. From frankg2008 at gmail.com Tue Jul 14 11:35:54 2015 From: frankg2008 at gmail.com (Frank) Date: Wed Jul 15 09:10:08 2015 Subject: [FX.php List] Finding match to an email address In-Reply-To: References: Message-ID: <66C6E48B-1A25-42CB-9017-FA1E0B7C1DBB@gmail.com> try this $q->AddDBParam('email',?==??.$email.?"'); From gfried at sonic.net Wed Jul 15 15:20:02 2015 From: gfried at sonic.net (Gary Frieders) Date: Wed Jul 15 15:20:12 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 11 In-Reply-To: <20150715144032.41D361B1DE5C@mail.iviking.org> References: <20150715144032.41D361B1DE5C@mail.iviking.org> Message-ID: <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> I have not been successful connecting FX to FMS 13 or 14. Had to go back to FMS 12 until I change all my web sites to FMP API. Unless someone knows how to connect FX to FMS 13 or 14. Gary Frieders > On Jul 15, 2015, at 7:40 AM, fx.php_list-request@mail.iviking.org wrote: > > Send FX.php_List mailing list submissions to > fx.php_list@mail.iviking.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.iviking.org/mailman/listinfo/fx.php_list > or, via email, send a message with subject or body 'help' to > fx.php_list-request@mail.iviking.org > > You can reach the person managing the list at > fx.php_list-owner@mail.iviking.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of FX.php_List digest..." > > > Today's Topics: > > 1. RE: Search Results To Text File -- SOLVED! (VanBuskirk, Patricia) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 15 Jul 2015 14:40:07 +0000 > From: "VanBuskirk, Patricia" > Subject: RE: [FX.php List] Search Results To Text File -- SOLVED! > To: FX.php Discussion List > Message-ID: > <7731A5AA5FC88D48831221524FB9D8901C466481@fsu-exch-nwr03.fsu.edu> > Content-Type: text/plain; charset="iso-8859-1" > > That looks MUCH better! Thanks, Malcolm! > > p.s. Using FM11 now, but converting to 14 soon. > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald > Sent: Tuesday, July 14, 2015 6:09 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File -- SOLVED! > > Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. > > let ( > row = List ( > quote( Business_Unit ) ; > quote ( WO_ID ) ; > quote ( Descr254 ) ; > ... > ) ; > substitute ( row ; ? ; "," ) > ) > > > > On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: > So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. > > FM field ( named cf_lineForExport ) : > > "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & > Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & > Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" > > PHP code : > > $fp = 'C:\\Temp\\NewOMNI.txt'; > > echo "
Found Records: ".count($searchResult)."
"; > > foreach ($searchResult as $record) { > > $line .= $record['cf_lineForExport']."\r\n" ; > file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); > > } > fclose($fp); > > > Comes out perfectly! Thanks again for all the tips and ideas! > > Trish V. > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia > Sent: Tuesday, July 14, 2015 7:41 AM > To: FX.php Discussion List > Subject: RE: [FX.php List] Search Results To Text File > > Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I'll let the group know what ends up working. > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald > Sent: Monday, July 13, 2015 5:59 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] Search Results To Text File > > There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. > > This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. > > function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { > # Check if $fields is an array > if (!is_array($fields)) { > return false; > } > # Walk through the data array > for ($i = 0, $n = count($fields); $i < $n; $i ++) { > # Duplicate in-value $enclosure's and put the value in $enclosure's > $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; > } > # Combine the data array with $delimiter and write it to the file > $line = implode($delimiter, $fields) . PHP_EOL ; > fwrite($handle, $line); > > # Return the length of the written data > return strlen($line); > } > > Malcolm > > On 14/07/2015 8:37 am, Dale Bengston wrote: > > Hi Trish, > > > > If your fields are in the same order coming off your FileMaker layout as you'd like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: > > > > foreach ($searchResult as $record) { > > $line = '"' . implode('","', $record) . '"' . "\n"; > > fwrite($fp, $line); > > } > > > > My email probably made those double quotes into typesetting quotes, so you'll probably have to put them back to straight quotes if you copy from here. > > > > Just a thought. > > > > Dale > > > > On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: > > > > Unfortunately, yes. It is being FTP'd to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the "golden" program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. > > > > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald > > Sent: Monday, July 13, 2015 3:46 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia, > > > > Are you absolutely sure that every field MUST have double quotes around it? > > > > The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? > > > > Malcolm > > > > > > > > On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: > > Hi guys, I think I'm really close. I'm getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: > > > > "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" > > "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" > > "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" > > > > Here's how it's coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ... '"'.$field1.'","'.field2 ... etc. > > > > > > > > Here's my code: > > > > > > > define('DEBUG', TRUE); > > require_once('FX.php'); > > require_once('server_data.php'); > > require_once('FMErrors.php'); > > > > > > $search=new FX(FM_IP, FM_PORT, FM_VERSION); > > $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); > > $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); > > $search->AddDBParam('Status_CD', 'OPEN'); > > $search->AddDBParam('ExportTimestamp', null); > > $search->AddDBParam('REQ_Start_Dt', ' * '); > > $search->AddDBParam('REQ_End_Dt', ' * '); > > $search->AddDBParam('Descr254', ' * '); > > $searchResult = $search->DoFXAction('perform_find'); > > > > $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); > > > > echo "
Found Records: ".count($searchResult)."
"; > > > > foreach ($searchResult as $record) { > > > > $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); > > fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; > > } > > fclose($fp); > > > > echo("
Error Code: {$search->lastErrorCode}
"); > > echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); > > echo "Error: ".$searchResult['errorCode']; > > > > ?> > > > > I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! > > > > Trish > > > > > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > > Sent: Thursday, July 9, 2015 4:01 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia > > > > So - if you're already using FX, then it should be pretty simple. In pseudo code > > > > * create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) > > * do a find for the records which need to be exported > > * use http://php.net/manual/en/function.fopen.php to create a file resource > > * feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested > > * close the file using http://php.net/manual/en/function.fclose.php > > > > HTH > > Steve > > > > > > > > > > Hi Steve (and Joel), > > > > We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). > > > > That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. > > > > Anywho.... I have replaced the import portion of it through FX, but haven't yet figured out how to do the export part. > > > > Thanks again for your responses! > > > > Trish > > > > > > -----Original Message----- > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter > > Sent: Thursday, July 9, 2015 3:36 PM > > To: FX.php Discussion List > > Subject: Re: [FX.php List] Search Results To Text File > > > > Hi Patricia > > > > There are many different ways to solve this problem ;-) > > > > Which version of FM server are you using...? it's certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. > > > > Otherwise either FX or the PHP API could also be used with a scheduled task. > > > > Cheers > > Steve > > > > > > > > > > Hi Group! > > > > Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? > > > > Example of how we need the results, > > > > "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" > > "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" > > "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" > > > > We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. > > > > Any assistance would be greatly appreciated! > > > > Trish > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > Steve Winter > > +44 777 852 4776 > > steve@bluecrocodile.co.nz > > > > > > > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > Steve Winter > > +44 777 852 4776 > > steve@bluecrocodile.co.nz > > > > > > > > > > > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/57751a8b/attachment.html > > ------------------------------ > > _______________________________________________ > FX.php_List > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > End of FX.php_List Digest, Vol 129, Issue 11 > ******************************************** > From bob at patin.com Wed Jul 15 15:24:51 2015 From: bob at patin.com (Bob Patin) Date: Wed Jul 15 15:24:56 2015 Subject: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 In-Reply-To: <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> References: <20150715144032.41D361B1DE5C@mail.iviking.org> <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> Message-ID: <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> Gary, It works fine (I use it on my site and elsewhere); a couple of things though: 1) if you use extensions in your database name, make sure it?s changed to fp7; 2) make sure you have the latest version of FX, because earlier ones aren?t going to work. Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > On Jul 15, 2015, at 4:20 PM, Gary Frieders wrote: > > I have not been successful connecting FX to FMS 13 or 14. > Had to go back to FMS 12 until I change all my web sites to FMP API. > > Unless someone knows how to connect FX to FMS 13 or 14. > > Gary Frieders > >> On Jul 15, 2015, at 7:40 AM, fx.php_list-request@mail.iviking.org wrote: >> >> Send FX.php_List mailing list submissions to >> fx.php_list@mail.iviking.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://www.iviking.org/mailman/listinfo/fx.php_list >> or, via email, send a message with subject or body 'help' to >> fx.php_list-request@mail.iviking.org >> >> You can reach the person managing the list at >> fx.php_list-owner@mail.iviking.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of FX.php_List digest..." >> >> >> Today's Topics: >> >> 1. RE: Search Results To Text File -- SOLVED! (VanBuskirk, Patricia) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Wed, 15 Jul 2015 14:40:07 +0000 >> From: "VanBuskirk, Patricia" >> Subject: RE: [FX.php List] Search Results To Text File -- SOLVED! >> To: FX.php Discussion List >> Message-ID: >> <7731A5AA5FC88D48831221524FB9D8901C466481@fsu-exch-nwr03.fsu.edu> >> Content-Type: text/plain; charset="iso-8859-1" >> >> That looks MUCH better! Thanks, Malcolm! >> >> p.s. Using FM11 now, but converting to 14 soon. >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >> Sent: Tuesday, July 14, 2015 6:09 PM >> To: FX.php Discussion List >> Subject: Re: [FX.php List] Search Results To Text File -- SOLVED! >> >> Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. >> >> let ( >> row = List ( >> quote( Business_Unit ) ; >> quote ( WO_ID ) ; >> quote ( Descr254 ) ; >> ... >> ) ; >> substitute ( row ; ? ; "," ) >> ) >> >> >> >> On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: >> So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. >> >> FM field ( named cf_lineForExport ) : >> >> "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & >> Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & >> Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" >> >> PHP code : >> >> $fp = 'C:\\Temp\\NewOMNI.txt'; >> >> echo "
Found Records: ".count($searchResult)."
"; >> >> foreach ($searchResult as $record) { >> >> $line .= $record['cf_lineForExport']."\r\n" ; >> file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); >> >> } >> fclose($fp); >> >> >> Comes out perfectly! Thanks again for all the tips and ideas! >> >> Trish V. >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia >> Sent: Tuesday, July 14, 2015 7:41 AM >> To: FX.php Discussion List >> Subject: RE: [FX.php List] Search Results To Text File >> >> Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I'll let the group know what ends up working. >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >> Sent: Monday, July 13, 2015 5:59 PM >> To: FX.php Discussion List >> Subject: Re: [FX.php List] Search Results To Text File >> >> There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. >> >> This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. >> >> function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { >> # Check if $fields is an array >> if (!is_array($fields)) { >> return false; >> } >> # Walk through the data array >> for ($i = 0, $n = count($fields); $i < $n; $i ++) { >> # Duplicate in-value $enclosure's and put the value in $enclosure's >> $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; >> } >> # Combine the data array with $delimiter and write it to the file >> $line = implode($delimiter, $fields) . PHP_EOL ; >> fwrite($handle, $line); >> >> # Return the length of the written data >> return strlen($line); >> } >> >> Malcolm >> >> On 14/07/2015 8:37 am, Dale Bengston wrote: >> >> Hi Trish, >> >> >> >> If your fields are in the same order coming off your FileMaker layout as you'd like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: >> >> >> >> foreach ($searchResult as $record) { >> >> $line = '"' . implode('","', $record) . '"' . "\n"; >> >> fwrite($fp, $line); >> >> } >> >> >> >> My email probably made those double quotes into typesetting quotes, so you'll probably have to put them back to straight quotes if you copy from here. >> >> >> >> Just a thought. >> >> >> >> Dale >> >> >> >> On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: >> >> >> >> Unfortunately, yes. It is being FTP'd to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the "golden" program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. >> >> >> >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >> >> Sent: Monday, July 13, 2015 3:46 PM >> >> To: FX.php Discussion List >> >> Subject: Re: [FX.php List] Search Results To Text File >> >> >> >> Hi Patricia, >> >> >> >> Are you absolutely sure that every field MUST have double quotes around it? >> >> >> >> The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? >> >> >> >> Malcolm >> >> >> >> >> >> >> >> On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: >> >> Hi guys, I think I'm really close. I'm getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: >> >> >> >> "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" >> >> "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" >> >> "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" >> >> >> >> Here's how it's coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ... '"'.$field1.'","'.field2 ... etc. >> >> >> >> >> >> >> >> Here's my code: >> >> >> >> > >> >> >> define('DEBUG', TRUE); >> >> require_once('FX.php'); >> >> require_once('server_data.php'); >> >> require_once('FMErrors.php'); >> >> >> >> >> >> $search=new FX(FM_IP, FM_PORT, FM_VERSION); >> >> $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); >> >> $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); >> >> $search->AddDBParam('Status_CD', 'OPEN'); >> >> $search->AddDBParam('ExportTimestamp', null); >> >> $search->AddDBParam('REQ_Start_Dt', ' * '); >> >> $search->AddDBParam('REQ_End_Dt', ' * '); >> >> $search->AddDBParam('Descr254', ' * '); >> >> $searchResult = $search->DoFXAction('perform_find'); >> >> >> >> $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); >> >> >> >> echo "
Found Records: ".count($searchResult)."
"; >> >> >> >> foreach ($searchResult as $record) { >> >> >> >> $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); >> >> fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; >> >> } >> >> fclose($fp); >> >> >> >> echo("
Error Code: {$search->lastErrorCode}
"); >> >> echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); >> >> echo "Error: ".$searchResult['errorCode']; >> >> >> >> ?> >> >> >> >> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! >> >> >> >> Trish >> >> >> >> >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >> >> Sent: Thursday, July 9, 2015 4:01 PM >> >> To: FX.php Discussion List >> >> Subject: Re: [FX.php List] Search Results To Text File >> >> >> >> Hi Patricia >> >> >> >> So - if you're already using FX, then it should be pretty simple. In pseudo code >> >> >> >> * create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) >> >> * do a find for the records which need to be exported >> >> * use http://php.net/manual/en/function.fopen.php to create a file resource >> >> * feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested >> >> * close the file using http://php.net/manual/en/function.fclose.php >> >> >> >> HTH >> >> Steve >> >> >> >> >> >> >> >> >> >> Hi Steve (and Joel), >> >> >> >> We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). >> >> >> >> That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. >> >> >> >> Anywho.... I have replaced the import portion of it through FX, but haven't yet figured out how to do the export part. >> >> >> >> Thanks again for your responses! >> >> >> >> Trish >> >> >> >> >> >> -----Original Message----- >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >> >> Sent: Thursday, July 9, 2015 3:36 PM >> >> To: FX.php Discussion List >> >> Subject: Re: [FX.php List] Search Results To Text File >> >> >> >> Hi Patricia >> >> >> >> There are many different ways to solve this problem ;-) >> >> >> >> Which version of FM server are you using...? it's certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. >> >> >> >> Otherwise either FX or the PHP API could also be used with a scheduled task. >> >> >> >> Cheers >> >> Steve >> >> >> >> >> >> >> >> >> >> Hi Group! >> >> >> >> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >> >> >> >> Example of how we need the results, >> >> >> >> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >> >> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >> >> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >> >> >> >> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >> >> >> >> Any assistance would be greatly appreciated! >> >> >> >> Trish >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> >> >> Steve Winter >> >> +44 777 852 4776 >> >> steve@bluecrocodile.co.nz >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> >> >> Steve Winter >> >> +44 777 852 4776 >> >> steve@bluecrocodile.co.nz >> >> >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> >> >> >> >> _______________________________________________ >> >> FX.php_List mailing list >> >> FX.php_List@mail.iviking.org >> >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/57751a8b/attachment.html >> >> ------------------------------ >> >> _______________________________________________ >> FX.php_List >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> End of FX.php_List Digest, Vol 129, Issue 11 >> ******************************************** >> > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/f557d0da/attachment-0001.html From dale.bengston at gmail.com Wed Jul 15 15:31:40 2015 From: dale.bengston at gmail.com (Dale Bengston) Date: Wed Jul 15 15:31:50 2015 Subject: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 In-Reply-To: <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> References: <20150715144032.41D361B1DE5C@mail.iviking.org> <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> Message-ID: <90DCF00C-4859-4E8B-96D4-EB725DD704A1@gmail.com> Hi Gary, In order to get it working, I had to do this. (Instructions straight from Chris Hansen.) 1. Download the latest version of FX.php. Even though I thought I had the latest, I didn?t. 2. Edit line 181 of the file /datasource_classes/RetrieveFM7Data.class.php from curl_setopt($curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); to curl_setopt($curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); This is what I had to do to get my existing FMS12-developed solution to work with FMS13. Hope this helps, Dale > On Jul 15, 2015, at 4:24 PM, Bob Patin wrote: > > Gary, > > It works fine (I use it on my site and elsewhere); a couple of things though: > > 1) if you use extensions in your database name, make sure it?s changed to fp7; > 2) make sure you have the latest version of FX, because earlier ones aren?t going to work. > > > Bob Patin > Longterm Solutions > bob@longtermsolutions.com > 615-333-6858 > FileMaker 9, 10, 11, 12 & 13 Certified Developer > http://www.longtermsolutions.com > - > iChat: bobpatin@me.com > Twitter: bobpatin > ? > FileMaker Consulting > FileMaker Hosting for all versions of FileMaker > PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > > >> On Jul 15, 2015, at 4:20 PM, Gary Frieders > wrote: >> >> I have not been successful connecting FX to FMS 13 or 14. >> Had to go back to FMS 12 until I change all my web sites to FMP API. >> >> Unless someone knows how to connect FX to FMS 13 or 14. >> >> Gary Frieders >> >>> On Jul 15, 2015, at 7:40 AM, fx.php_list-request@mail.iviking.org wrote: >>> >>> Send FX.php_List mailing list submissions to >>> fx.php_list@mail.iviking.org >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> or, via email, send a message with subject or body 'help' to >>> fx.php_list-request@mail.iviking.org >>> >>> You can reach the person managing the list at >>> fx.php_list-owner@mail.iviking.org >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of FX.php_List digest..." >>> >>> >>> Today's Topics: >>> >>> 1. RE: Search Results To Text File -- SOLVED! (VanBuskirk, Patricia) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Wed, 15 Jul 2015 14:40:07 +0000 >>> From: "VanBuskirk, Patricia" >>> Subject: RE: [FX.php List] Search Results To Text File -- SOLVED! >>> To: FX.php Discussion List >>> Message-ID: >>> <7731A5AA5FC88D48831221524FB9D8901C466481@fsu-exch-nwr03.fsu.edu> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> That looks MUCH better! Thanks, Malcolm! >>> >>> p.s. Using FM11 now, but converting to 14 soon. >>> >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>> Sent: Tuesday, July 14, 2015 6:09 PM >>> To: FX.php Discussion List >>> Subject: Re: [FX.php List] Search Results To Text File -- SOLVED! >>> >>> Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. >>> >>> let ( >>> row = List ( >>> quote( Business_Unit ) ; >>> quote ( WO_ID ) ; >>> quote ( Descr254 ) ; >>> ... >>> ) ; >>> substitute ( row ; ? ; "," ) >>> ) >>> >>> >>> >>> On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: >>> So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. >>> >>> FM field ( named cf_lineForExport ) : >>> >>> "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & >>> Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & >>> Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" >>> >>> PHP code : >>> >>> $fp = 'C:\\Temp\\NewOMNI.txt'; >>> >>> echo "
Found Records: ".count($searchResult)."
"; >>> >>> foreach ($searchResult as $record) { >>> >>> $line .= $record['cf_lineForExport']."\r\n" ; >>> file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); >>> >>> } >>> fclose($fp); >>> >>> >>> Comes out perfectly! Thanks again for all the tips and ideas! >>> >>> Trish V. >>> >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia >>> Sent: Tuesday, July 14, 2015 7:41 AM >>> To: FX.php Discussion List >>> Subject: RE: [FX.php List] Search Results To Text File >>> >>> Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I'll let the group know what ends up working. >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>> Sent: Monday, July 13, 2015 5:59 PM >>> To: FX.php Discussion List >>> Subject: Re: [FX.php List] Search Results To Text File >>> >>> There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. >>> >>> This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. >>> >>> function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { >>> # Check if $fields is an array >>> if (!is_array($fields)) { >>> return false; >>> } >>> # Walk through the data array >>> for ($i = 0, $n = count($fields); $i < $n; $i ++) { >>> # Duplicate in-value $enclosure's and put the value in $enclosure's >>> $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; >>> } >>> # Combine the data array with $delimiter and write it to the file >>> $line = implode($delimiter, $fields) . PHP_EOL ; >>> fwrite($handle, $line); >>> >>> # Return the length of the written data >>> return strlen($line); >>> } >>> >>> Malcolm >>> >>> On 14/07/2015 8:37 am, Dale Bengston wrote: >>> >>> Hi Trish, >>> >>> >>> >>> If your fields are in the same order coming off your FileMaker layout as you'd like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: >>> >>> >>> >>> foreach ($searchResult as $record) { >>> >>> $line = '"' . implode('","', $record) . '"' . "\n"; >>> >>> fwrite($fp, $line); >>> >>> } >>> >>> >>> >>> My email probably made those double quotes into typesetting quotes, so you'll probably have to put them back to straight quotes if you copy from here. >>> >>> >>> >>> Just a thought. >>> >>> >>> >>> Dale >>> >>> >>> >>> On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: >>> >>> >>> >>> Unfortunately, yes. It is being FTP'd to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the "golden" program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. >>> >>> >>> >>> >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>> >>> Sent: Monday, July 13, 2015 3:46 PM >>> >>> To: FX.php Discussion List >>> >>> Subject: Re: [FX.php List] Search Results To Text File >>> >>> >>> >>> Hi Patricia, >>> >>> >>> >>> Are you absolutely sure that every field MUST have double quotes around it? >>> >>> >>> >>> The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? >>> >>> >>> >>> Malcolm >>> >>> >>> >>> >>> >>> >>> >>> On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: >>> >>> Hi guys, I think I'm really close. I'm getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: >>> >>> >>> >>> "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" >>> >>> "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" >>> >>> "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" >>> >>> >>> >>> Here's how it's coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ... '"'.$field1.'","'.field2 ... etc. >>> >>> >>> >>> >>> >>> >>> >>> Here's my code: >>> >>> >>> >>> >> >>> >>> >>> define('DEBUG', TRUE); >>> >>> require_once('FX.php'); >>> >>> require_once('server_data.php'); >>> >>> require_once('FMErrors.php'); >>> >>> >>> >>> >>> >>> $search=new FX(FM_IP, FM_PORT, FM_VERSION); >>> >>> $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); >>> >>> $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); >>> >>> $search->AddDBParam('Status_CD', 'OPEN'); >>> >>> $search->AddDBParam('ExportTimestamp', null); >>> >>> $search->AddDBParam('REQ_Start_Dt', ' * '); >>> >>> $search->AddDBParam('REQ_End_Dt', ' * '); >>> >>> $search->AddDBParam('Descr254', ' * '); >>> >>> $searchResult = $search->DoFXAction('perform_find'); >>> >>> >>> >>> $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); >>> >>> >>> >>> echo "
Found Records: ".count($searchResult)."
"; >>> >>> >>> >>> foreach ($searchResult as $record) { >>> >>> >>> >>> $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); >>> >>> fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; >>> >>> } >>> >>> fclose($fp); >>> >>> >>> >>> echo("
Error Code: {$search->lastErrorCode}
"); >>> >>> echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); >>> >>> echo "Error: ".$searchResult['errorCode']; >>> >>> >>> >>> ?> >>> >>> >>> >>> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! >>> >>> >>> >>> Trish >>> >>> >>> >>> >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >>> >>> Sent: Thursday, July 9, 2015 4:01 PM >>> >>> To: FX.php Discussion List >>> >>> Subject: Re: [FX.php List] Search Results To Text File >>> >>> >>> >>> Hi Patricia >>> >>> >>> >>> So - if you're already using FX, then it should be pretty simple. In pseudo code >>> >>> >>> >>> * create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) >>> >>> * do a find for the records which need to be exported >>> >>> * use http://php.net/manual/en/function.fopen.php to create a file resource >>> >>> * feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested >>> >>> * close the file using http://php.net/manual/en/function.fclose.php >>> >>> >>> >>> HTH >>> >>> Steve >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Hi Steve (and Joel), >>> >>> >>> >>> We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). >>> >>> >>> >>> That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. >>> >>> >>> >>> Anywho.... I have replaced the import portion of it through FX, but haven't yet figured out how to do the export part. >>> >>> >>> >>> Thanks again for your responses! >>> >>> >>> >>> Trish >>> >>> >>> >>> >>> >>> -----Original Message----- >>> >>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >>> >>> Sent: Thursday, July 9, 2015 3:36 PM >>> >>> To: FX.php Discussion List >>> >>> Subject: Re: [FX.php List] Search Results To Text File >>> >>> >>> >>> Hi Patricia >>> >>> >>> >>> There are many different ways to solve this problem ;-) >>> >>> >>> >>> Which version of FM server are you using...? it's certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. >>> >>> >>> >>> Otherwise either FX or the PHP API could also be used with a scheduled task. >>> >>> >>> >>> Cheers >>> >>> Steve >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Hi Group! >>> >>> >>> >>> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >>> >>> >>> >>> Example of how we need the results, >>> >>> >>> >>> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >>> >>> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >>> >>> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >>> >>> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >>> >>> >>> >>> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >>> >>> >>> >>> Any assistance would be greatly appreciated! >>> >>> >>> >>> Trish >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> >>> >>> Steve Winter >>> >>> +44 777 852 4776 >>> >>> steve@bluecrocodile.co.nz >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> >>> >>> Steve Winter >>> >>> +44 777 852 4776 >>> >>> steve@bluecrocodile.co.nz >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> FX.php_List mailing list >>> >>> FX.php_List@mail.iviking.org >>> >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/57751a8b/attachment.html >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> FX.php_List >>> FX.php_List@mail.iviking.org >>> http://www.iviking.org/mailman/listinfo/fx.php_list >>> >>> End of FX.php_List Digest, Vol 129, Issue 11 >>> ******************************************** >>> >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/d37d92f2/attachment-0001.html From bob at patin.com Wed Jul 15 15:35:16 2015 From: bob at patin.com (Bob Patin) Date: Wed Jul 15 15:35:23 2015 Subject: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 In-Reply-To: <90DCF00C-4859-4E8B-96D4-EB725DD704A1@gmail.com> References: <20150715144032.41D361B1DE5C@mail.iviking.org> <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> <90DCF00C-4859-4E8B-96D4-EB725DD704A1@gmail.com> Message-ID: <2D71AD77-87F7-4FD2-A29A-AF0DCE28C104@patin.com> I don?t remember doing that; I *may* have, but I don?t think I did. Also, I?ve moved existing web apps from one server to another?the first running FMS 12 and the 2nd running FMS 13?and had no issues at all. In fact, that?s what I did with the database that feeds the blog on my website. Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting > On Jul 15, 2015, at 4:31 PM, Dale Bengston wrote: > > Hi Gary, > > In order to get it working, I had to do this. (Instructions straight from Chris Hansen.) > > 1. Download the latest version of FX.php. Even though I thought I had the latest, I didn?t. > 2. Edit line 181 of the file /datasource_classes/RetrieveFM7Data.class.php from > > curl_setopt($curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); > > to > > curl_setopt($curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); > > This is what I had to do to get my existing FMS12-developed solution to work with FMS13. > > Hope this helps, > Dale > > >> On Jul 15, 2015, at 4:24 PM, Bob Patin > wrote: >> >> Gary, >> >> It works fine (I use it on my site and elsewhere); a couple of things though: >> >> 1) if you use extensions in your database name, make sure it?s changed to fp7; >> 2) make sure you have the latest version of FX, because earlier ones aren?t going to work. >> >> >> Bob Patin >> Longterm Solutions >> bob@longtermsolutions.com >> 615-333-6858 >> FileMaker 9, 10, 11, 12 & 13 Certified Developer >> http://www.longtermsolutions.com >> - >> iChat: bobpatin@me.com >> Twitter: bobpatin >> ? >> FileMaker Consulting >> FileMaker Hosting for all versions of FileMaker >> PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting >> >> >>> On Jul 15, 2015, at 4:20 PM, Gary Frieders > wrote: >>> >>> I have not been successful connecting FX to FMS 13 or 14. >>> Had to go back to FMS 12 until I change all my web sites to FMP API. >>> >>> Unless someone knows how to connect FX to FMS 13 or 14. >>> >>> Gary Frieders >>> >>>> On Jul 15, 2015, at 7:40 AM, fx.php_list-request@mail.iviking.org wrote: >>>> >>>> Send FX.php_List mailing list submissions to >>>> fx.php_list@mail.iviking.org >>>> >>>> To subscribe or unsubscribe via the World Wide Web, visit >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> or, via email, send a message with subject or body 'help' to >>>> fx.php_list-request@mail.iviking.org >>>> >>>> You can reach the person managing the list at >>>> fx.php_list-owner@mail.iviking.org >>>> >>>> When replying, please edit your Subject line so it is more specific >>>> than "Re: Contents of FX.php_List digest..." >>>> >>>> >>>> Today's Topics: >>>> >>>> 1. RE: Search Results To Text File -- SOLVED! (VanBuskirk, Patricia) >>>> >>>> >>>> ---------------------------------------------------------------------- >>>> >>>> Message: 1 >>>> Date: Wed, 15 Jul 2015 14:40:07 +0000 >>>> From: "VanBuskirk, Patricia" >>>> Subject: RE: [FX.php List] Search Results To Text File -- SOLVED! >>>> To: FX.php Discussion List >>>> Message-ID: >>>> <7731A5AA5FC88D48831221524FB9D8901C466481@fsu-exch-nwr03.fsu.edu> >>>> Content-Type: text/plain; charset="iso-8859-1" >>>> >>>> That looks MUCH better! Thanks, Malcolm! >>>> >>>> p.s. Using FM11 now, but converting to 14 soon. >>>> >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>>> Sent: Tuesday, July 14, 2015 6:09 PM >>>> To: FX.php Discussion List >>>> Subject: Re: [FX.php List] Search Results To Text File -- SOLVED! >>>> >>>> Unless you are working with FMP8 you have the Quote( ) function and the List( ) functions available. They work together nicely to make this sort of code legible. >>>> >>>> let ( >>>> row = List ( >>>> quote( Business_Unit ) ; >>>> quote ( WO_ID ) ; >>>> quote ( Descr254 ) ; >>>> ... >>>> ) ; >>>> substitute ( row ; ? ; "," ) >>>> ) >>>> >>>> >>>> >>>> On 15/07/2015 2:44 am, VanBuskirk, Patricia wrote: >>>> So, I was able to get it to work by creating a calculated field in the database that created the line of formatted info I needed for the export. Then, I used the fwrite function. >>>> >>>> FM field ( named cf_lineForExport ) : >>>> >>>> "\"" & Business_Unit & "\",\"" & WO_ID & "\",\"" & Descr254 & "\",\"" & WO_Type & "\",\"" & Shop_ID & "\",\"" & Srvc_Grp_ID & "\",\"" & Priority_CD & "\",\"" & Status_CD & "\",\"" & Status_DTTM & "\",\"" & >>>> Right ( "00"& Month ( REQ_Start_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_Start_Dt ) ; 2 ) & "/" & Year ( REQ_Start_Dt ) & "\",\"" & >>>> Right ( "00"& Month ( REQ_End_Dt ) ; 2 ) & "/" & Right ( "00"& Day ( REQ_End_Dt ) ; 2 ) & "/" & Year ( REQ_End_Dt ) & "\"" >>>> >>>> PHP code : >>>> >>>> $fp = 'C:\\Temp\\NewOMNI.txt'; >>>> >>>> echo "
Found Records: ".count($searchResult)."
"; >>>> >>>> foreach ($searchResult as $record) { >>>> >>>> $line .= $record['cf_lineForExport']."\r\n" ; >>>> file_put_contents($fp, $line, FILE_APPEND | LOCK_EX); >>>> >>>> } >>>> fclose($fp); >>>> >>>> >>>> Comes out perfectly! Thanks again for all the tips and ideas! >>>> >>>> Trish V. >>>> >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of VanBuskirk, Patricia >>>> Sent: Tuesday, July 14, 2015 7:41 AM >>>> To: FX.php Discussion List >>>> Subject: RE: [FX.php List] Search Results To Text File >>>> >>>> Thanks Malcolm and Dale! I will check out your suggestions today. I truly appreciate the help! I'll let the group know what ends up working. >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>>> Sent: Monday, July 13, 2015 5:59 PM >>>> To: FX.php Discussion List >>>> Subject: Re: [FX.php List] Search Results To Text File >>>> >>>> There are two other considerations. First, you must escape your field delimiters if they occur within the data. Second, what are the rules concerned your record delimiter, if it appears within the data. Lots of import programs give record delimiters a higher priority than field delimiters causing all sorts of mess. >>>> >>>> This function was amongst the comments on the fputcsv page at php.net. I modified it slightly, the original by R dot Mansveld at Spider-IT dot de, didn't quote numerals. >>>> >>>> function fwritecsv($handle, $fields, $delimiter = ',', $enclosure = '"') { >>>> # Check if $fields is an array >>>> if (!is_array($fields)) { >>>> return false; >>>> } >>>> # Walk through the data array >>>> for ($i = 0, $n = count($fields); $i < $n; $i ++) { >>>> # Duplicate in-value $enclosure's and put the value in $enclosure's >>>> $fields[$i] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $fields[$i]) . $enclosure; >>>> } >>>> # Combine the data array with $delimiter and write it to the file >>>> $line = implode($delimiter, $fields) . PHP_EOL ; >>>> fwrite($handle, $line); >>>> >>>> # Return the length of the written data >>>> return strlen($line); >>>> } >>>> >>>> Malcolm >>>> >>>> On 14/07/2015 8:37 am, Dale Bengston wrote: >>>> >>>> Hi Trish, >>>> >>>> >>>> >>>> If your fields are in the same order coming off your FileMaker layout as you'd like them in the file, you can make a string out of each record's data and write it to your file, using fwrite instead of fputcsv: >>>> >>>> >>>> >>>> foreach ($searchResult as $record) { >>>> >>>> $line = '"' . implode('","', $record) . '"' . "\n"; >>>> >>>> fwrite($fp, $line); >>>> >>>> } >>>> >>>> >>>> >>>> My email probably made those double quotes into typesetting quotes, so you'll probably have to put them back to straight quotes if you copy from here. >>>> >>>> >>>> >>>> Just a thought. >>>> >>>> >>>> >>>> Dale >>>> >>>> >>>> >>>> On Jul 13, 2015, at 2:53 PM, VanBuskirk, Patricia wrote: >>>> >>>> >>>> >>>> Unfortunately, yes. It is being FTP'd to a holding directory and then picked up and imported into a PeopleSoft inventory system. So, either it CANNOT or they WILL NOT use any other formatting. Either way, that is the "golden" program around here, and FileMaker is hated and looked down upon. So the odds of getting that changed are lower than that of zombies invading the Earth. >>>> >>>> >>>> >>>> >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Malcolm Fitzgerald >>>> >>>> Sent: Monday, July 13, 2015 3:46 PM >>>> >>>> To: FX.php Discussion List >>>> >>>> Subject: Re: [FX.php List] Search Results To Text File >>>> >>>> >>>> >>>> Hi Patricia, >>>> >>>> >>>> >>>> Are you absolutely sure that every field MUST have double quotes around it? >>>> >>>> >>>> >>>> The whole point of CSV is to pass it onto another app. Is the app that you are passing the data to rejecting the file? >>>> >>>> >>>> >>>> Malcolm >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On 14/07/2015 6:44 am, VanBuskirk, Patricia wrote: >>>> >>>> Hi guys, I think I'm really close. I'm getting it to create the file, but I am struggling with the format. Each field needs to have double quotes around it, as in the following example: >>>> >>>> >>>> >>>> "FSU01","RN260715","Facilities Department - MENDENHALL BUILDING A (MMA) - 969 LEARNING WAY","RN","OTC","OTC","1","OPEN","","5/19/2015","5/19/2016" >>>> >>>> "FSU01","RN260815","Procurement Services & Help Desk - UNIVERSITY CENTER - BLDG. A (UCA) - 282 CHAMPIONS WAY","RN","OTC","OTC","1","OPEN","","5/20/2015","5/20/2016" >>>> >>>> "FSU01","TSR0299915","Medicine College of Dean's Office - COM -THRASHER BLDG. 1115 W CALL ST","TSR","OTC","OTC","2","OPEN","","5/20/2015","5/20/2016" >>>> >>>> >>>> >>>> Here's how it's coming out now. It is putting a little square when the carriage return should be, and the fields are not being surrounded by quotation marks. I tried using the $delimiter and $enclosure parameters, but they put random quotation marks in (maybe just around text fields?). I can get it to echo to the page properly, by using ... '"'.$field1.'","'.field2 ... etc. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Here's my code: >>>> >>>> >>>> >>>> >>> >>>> >>>> >>>> define('DEBUG', TRUE); >>>> >>>> require_once('FX.php'); >>>> >>>> require_once('server_data.php'); >>>> >>>> require_once('FMErrors.php'); >>>> >>>> >>>> >>>> >>>> >>>> $search=new FX(FM_IP, FM_PORT, FM_VERSION); >>>> >>>> $search->SetDBData('WorkOrders_TST.fp7','SeeALL'); >>>> >>>> $search->SetDBUserPass(FM_USERNAME, FM_PASSWORD); >>>> >>>> $search->AddDBParam('Status_CD', 'OPEN'); >>>> >>>> $search->AddDBParam('ExportTimestamp', null); >>>> >>>> $search->AddDBParam('REQ_Start_Dt', ' * '); >>>> >>>> $search->AddDBParam('REQ_End_Dt', ' * '); >>>> >>>> $search->AddDBParam('Descr254', ' * '); >>>> >>>> $searchResult = $search->DoFXAction('perform_find'); >>>> >>>> >>>> >>>> $fp = fopen("C:\\Temp\\NewOMNI.txt", "w"); >>>> >>>> >>>> >>>> echo "
Found Records: ".count($searchResult)."
"; >>>> >>>> >>>> >>>> foreach ($searchResult as $record) { >>>> >>>> >>>> >>>> $linearray=array($record['Business_Unit'],$record['WO_ID'],$record['Descr254'],$record['WO_Type'],$record['Shop_ID']); >>>> >>>> fputcsv ( $fp , $linearray, $delimiter = ',', $enclosure = '"' )."\l" ; >>>> >>>> } >>>> >>>> fclose($fp); >>>> >>>> >>>> >>>> echo("
Error Code: {$search->lastErrorCode}
"); >>>> >>>> echo("FileMaker Error Message: {$errorsList[$search->lastErrorCode]}

"); >>>> >>>> echo "Error: ".$searchResult['errorCode']; >>>> >>>> >>>> >>>> ?> >>>> >>>> >>>> >>>> I have been messing with this darn thing for several days now, so any tips or direction given will be greatly appreciated! >>>> >>>> >>>> >>>> Trish >>>> >>>> >>>> >>>> >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >>>> >>>> Sent: Thursday, July 9, 2015 4:01 PM >>>> >>>> To: FX.php Discussion List >>>> >>>> Subject: Re: [FX.php List] Search Results To Text File >>>> >>>> >>>> >>>> Hi Patricia >>>> >>>> >>>> >>>> So - if you're already using FX, then it should be pretty simple. In pseudo code >>>> >>>> >>>> >>>> * create a brand new layout and place the fields you need to export, in the order you need to export them on that layout from top to bottom (this may sounds mad, but what it will mean is that when the FX array of records comes back the fields will be in the right order) >>>> >>>> * do a find for the records which need to be exported >>>> >>>> * use http://php.net/manual/en/function.fopen.php to create a file resource >>>> >>>> * feed the file resource and the FX array of returned records into http://php.net/manual/en/function.fputcsv.php which Joel suggested >>>> >>>> * close the file using http://php.net/manual/en/function.fclose.php >>>> >>>> >>>> >>>> HTH >>>> >>>> Steve >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Hi Steve (and Joel), >>>> >>>> >>>> >>>> We are currently using FMS 11Adv, but have plans to upgrade to 14 as soon as budget is approved (as fast a herd of turtles around here). >>>> >>>> >>>> >>>> That robot has been in use using a script running plug-in for years, importing orders from the web, then creating a csv of certain info for our PeopleSoft folks to import into their inventory system (which is why ODBC is not an option). They have very specific formatting that they must have or their import will fail. >>>> >>>> >>>> >>>> Anywho.... I have replaced the import portion of it through FX, but haven't yet figured out how to do the export part. >>>> >>>> >>>> >>>> Thanks again for your responses! >>>> >>>> >>>> >>>> Trish >>>> >>>> >>>> >>>> >>>> >>>> -----Original Message----- >>>> >>>> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Steve Winter >>>> >>>> Sent: Thursday, July 9, 2015 3:36 PM >>>> >>>> To: FX.php Discussion List >>>> >>>> Subject: Re: [FX.php List] Search Results To Text File >>>> >>>> >>>> >>>> Hi Patricia >>>> >>>> >>>> >>>> There are many different ways to solve this problem ;-) >>>> >>>> >>>> >>>> Which version of FM server are you using...? it's certainly possible with both 13 and 14 to export records to csv with a server-side script, so this is going to be the simplest way to go about it. >>>> >>>> >>>> >>>> Otherwise either FX or the PHP API could also be used with a scheduled task. >>>> >>>> >>>> >>>> Cheers >>>> >>>> Steve >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Hi Group! >>>> >>>> >>>> >>>> Is there a way, using fx.php to create a csv text file of search results on the FM or web publishing server? >>>> >>>> >>>> >>>> Example of how we need the results, >>>> >>>> >>>> >>>> "FSU01","TSR0002216","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/06/2015","07/06/2016" >>>> >>>> "FSU01","TSR0002316","Arts & Sciences College of - ","TSR","OTC","OTC","2","OPEN","","07/08/2015","07/08/2016" >>>> >>>> "FSU01","TSR0002916","Information Technology Services (ITS) - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >>>> >>>> "FSU01","TSR0003016","Alumni Association - ","TSR","OTC","OTC","2","OPEN","","07/09/2015","07/09/2016" >>>> >>>> >>>> >>>> We presently have a "script robot" set up that exports a file every 1/2 hour within a FM client. We are trying to get rid of that FM installation and automate it through php. I was actually trying to run a FM script through FM Server, but it seems export is not a permitted script step for server script scheduling. >>>> >>>> >>>> >>>> Any assistance would be greatly appreciated! >>>> >>>> >>>> >>>> Trish >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> >>>> >>>> Steve Winter >>>> >>>> +44 777 852 4776 >>>> >>>> steve@bluecrocodile.co.nz >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> >>>> >>>> Steve Winter >>>> >>>> +44 777 852 4776 >>>> >>>> steve@bluecrocodile.co.nz >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> FX.php_List mailing list >>>> >>>> FX.php_List@mail.iviking.org >>>> >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> -------------- next part -------------- >>>> An HTML attachment was scrubbed... >>>> URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/57751a8b/attachment.html >>>> >>>> ------------------------------ >>>> >>>> _______________________________________________ >>>> FX.php_List >>>> FX.php_List@mail.iviking.org >>>> http://www.iviking.org/mailman/listinfo/fx.php_list >>>> >>>> End of FX.php_List Digest, Vol 129, Issue 11 >>>> ******************************************** >>>> >>> >>> _______________________________________________ >>> FX.php_List mailing list >>> FX.php_List@mail.iviking.org >>> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/a66ed046/attachment-0001.html From dale.bengston at gmail.com Wed Jul 15 15:38:15 2015 From: dale.bengston at gmail.com (Dale Bengston) Date: Wed Jul 15 15:38:22 2015 Subject: [FX.php List] FMS 13 References: <317F07E4-9218-481F-A663-7A11C4FE0E8E@iViking.org> Message-ID: <008DECCA-93B3-4E28-9AE4-9031F5FC9CA0@gmail.com> Here is Chris? message from June 18. > Begin forwarded message: > > From: Chris Hansen > Subject: Re: [FX.php List] FMS 13 > Date: June 18, 2015 at 11:57:28 AM CDT > To: "FX.php Discussion List" > Reply-To: "FX.php Discussion List" > > Dale, > > I just helped someone with this the other day. One difficulty is that after moving FX.php to github, I stopped being careful about updating the version numbering (I've repented, and the current development branch is version 6.9). Anyway, here are the things we did to get the other install working: > > 1) Grabbed the latest production version from github, and installed it. > > 2) After doing the above, there was an authentication error. We fixed that by finding the curl_setopt() call dealing with CURLOPT_HTTPAUTH and changing the value from CURLAUTH_BASIC to CURLAUTH_ANY, or vice versa. (I am making this a simpler tweak in the development version of FX.php.) > > 3) Finally, when looking at the XML path being output during debugging, I noticed that the path was for version 6 and earlier of FileMaker (for whatever reason it was defaulting to that), so we added the FileMaker version explicitly. I expect this last one won't be a problem for you, but just in case... > > Hope this helps. I'm currently working on some long overdue polishing, etc. that should make dealing with things like this easier. > > Best, > > --Chris > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/9469358a/attachment.html From dness at bondedbuilders.com Wed Jul 15 15:38:50 2015 From: dness at bondedbuilders.com (Ness, David) Date: Wed Jul 15 15:38:54 2015 Subject: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 In-Reply-To: <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> References: <20150715144032.41D361B1DE5C@mail.iviking.org> <4904A175-6477-4A64-849F-CFADCD226B2E@sonic.net> <4A1791DA-EDEE-4C8B-8759-33FE36A5DCF0@patin.com> Message-ID: It works fine for me also, and I am currently using both FMSv13 & FMSv14. I?m using fx.PHP v6. $query = new FX( $serverIP, $webCompanionPort, $dataSourceType, $scheme ); Where: $webCompanionPort = 80; $scheme = 'http'; // or ?https? as needed $dataSourceType = 'FMPro7'; With regard to Bob?s recommendation #1 below, I think it?s best to just not use filename extensions. fx.php doesn?t need them, and once removed you never have to worry about an extension change in the future. David Ness FileMaker & Web Applications Developer Bonded Builders Warranty Group St. Petersburg, Florida USA 800-749-0381 x4923 From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Bob Patin Sent: Wednesday, July 15, 2015 5:25 PM To: FX.php Discussion List Subject: Re: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 Gary, It works fine (I use it on my site and elsewhere); a couple of things though: 1) if you use extensions in your database name, make sure it?s changed to fp7; 2) make sure you have the latest version of FX, because earlier ones aren?t going to work. Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/4b8a7d0f/attachment.html From tcmeyers at troymeyers.com Sun Jul 19 09:10:41 2015 From: tcmeyers at troymeyers.com (Troy Meyers) Date: Sun Jul 19 09:10:52 2015 Subject: [FX.php List] FileMaker Server 14 and FX.php Message-ID: <187BC6FA.2A35.4356.BE89.7A59C1A785A0@111.1268501> Chris, Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. Am I wrong? -Troy > Hey Folks, > > I'm going to have to update my server hardware to test compatibility > between FMS14 and FX.php, but I have started to receive questions about > compatibility. Rather than wait for me to get around to a hardware > upgrade (up to my ears in alligators right now...), I have a few > questions for all y'all: > > 1) Has anyone tested FMS14 with FX.php? > > 2) For anyone who has, any particular observations, gotchas, etc.? > > 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is > still fixed in FMS14? > > Thanks! From ted-fitzgerald at uiowa.edu Sun Jul 19 19:44:01 2015 From: ted-fitzgerald at uiowa.edu (Fitzgerald, Theodore C) Date: Sun Jul 19 19:44:08 2015 Subject: [FX.php List] FileMaker Server 14 and FX.php In-Reply-To: <187BC6FA.2A35.4356.BE89.7A59C1A785A0@111.1268501> References: <187BC6FA.2A35.4356.BE89.7A59C1A785A0@111.1268501> Message-ID: Troy, I looked at this a while ago and in my initial testing, it seemed to be fixed...however; I just did a bit more in depth testing and it looks like I may have been premature in declaring this fixed. I think the layout I looked at originally had empty portals, but they were at the end of the query / code, so it appeared to work fine. If the first portal is empty, some of the page works fine, but other parts are messed up. I also took a look at 13.v09 again and it also does not appear to be fixed as some others had reported (myself included). Ted ________________________________________ From: fx.php_list-bounces@mail.iviking.org [fx.php_list-bounces@mail.iviking.org] on behalf of Troy Meyers [tcmeyers@troymeyers.com] Sent: Sunday, July 19, 2015 10:10 AM To: FX.php Discussion List Subject: Re: [FX.php List] FileMaker Server 14 and FX.php Chris, Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. Am I wrong? -Troy > Hey Folks, > > I'm going to have to update my server hardware to test compatibility > between FMS14 and FX.php, but I have started to receive questions about > compatibility. Rather than wait for me to get around to a hardware > upgrade (up to my ears in alligators right now...), I have a few > questions for all y'all: > > 1) Has anyone tested FMS14 with FX.php? > > 2) For anyone who has, any particular observations, gotchas, etc.? > > 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is > still fixed in FMS14? > > Thanks! _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list From tcmeyers at troymeyers.com Mon Jul 20 18:58:12 2015 From: tcmeyers at troymeyers.com (Troy Meyers) Date: Mon Jul 20 18:58:22 2015 Subject: [FX.php List] FileMaker Server 14 and FX.php Message-ID: <185672DC.893C.47FA.8128.D88776736590@111.1268538> Ted, Thank you for confirming this. I guess we still need to use the verbose "fmalt". Chris, please take note! -Troy ________________________________________ Troy, I looked at this a while ago and in my initial testing, it seemed to be fixed...however; I just did a bit more in depth testing and it looks like I may have been premature in declaring this fixed. I think the layout I looked at originally had empty portals, but they were at the end of the query / code, so it appeared to work fine. If the first portal is empty, some of the page works fine, but other parts are messed up. I also took a look at 13.v09 again and it also does not appear to be fixed as some others had reported (myself included). Ted ________________________________________ From: fx.php_list-bounces@mail.iviking.org [fx.php_list-bounces@mail.iviking.org] on behalf of Troy Meyers [tcmeyers@troymeyers.com] Sent: Sunday, July 19, 2015 10:10 AM To: FX.php Discussion List Subject: Re: [FX.php List] FileMaker Server 14 and FX.php Chris, Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. Am I wrong? -Troy > Hey Folks, > > I'm going to have to update my server hardware to test compatibility > between FMS14 and FX.php, but I have started to receive questions about > compatibility. Rather than wait for me to get around to a hardware > upgrade (up to my ears in alligators right now...), I have a few > questions for all y'all: > > 1) Has anyone tested FMS14 with FX.php? > > 2) For anyone who has, any particular observations, gotchas, etc.? > > 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is > still fixed in FMS14? > > Thanks! _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list _______________________________________________ FX.php_List mailing list FX.php_List@mail.iviking.org http://www.iviking.org/mailman/listinfo/fx.php_list From chris at iViking.org Wed Jul 22 23:15:04 2015 From: chris at iViking.org (Chris Hansen) Date: Wed Jul 22 23:10:59 2015 Subject: [FX.php List] FileMaker Server 14 and FX.php In-Reply-To: <185672DC.893C.47FA.8128.D88776736590@111.1268538> References: <185672DC.893C.47FA.8128.D88776736590@111.1268538> Message-ID: <19E8095D-B325-4C7E-AABF-6E3EFDB48941@iViking.org> That IS odd. I did some testing myself and things seemed good -- at least in some situations that had broken before. I specifically checked instances where a field was blank in a middle record, and whether the data would still line up properly. I'll have to do a bit more digging to figure out what bits are broken. Thanks! --Chris > On Jul 20, 2015, at 6:58 PM, Troy Meyers wrote: > > Ted, > > Thank you for confirming this. I guess we still need to use the verbose "fmalt". > > Chris, please take note! > > -Troy > > > > ________________________________________ > Troy, > I looked at this a while ago and in my initial testing, it seemed to be fixed...however; I just did a bit more in depth testing and it looks like I may have been premature in declaring this fixed. I think the layout I looked at originally had empty portals, but they were at the end of the query / code, so it appeared to work fine. If the first portal is empty, some of the page works fine, but other parts are messed up. > I also took a look at 13.v09 again and it also does not appear to be fixed as some others had reported (myself included). > Ted > ________________________________________ > From: fx.php_list-bounces@mail.iviking.org [fx.php_list-bounces@mail.iviking.org] on behalf of Troy Meyers [tcmeyers@troymeyers.com] > Sent: Sunday, July 19, 2015 10:10 AM > To: FX.php Discussion List > Subject: Re: [FX.php List] FileMaker Server 14 and FX.php > Chris, > Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. > I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. > I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. > I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. > Am I wrong? > -Troy >> Hey Folks, >> >> I'm going to have to update my server hardware to test compatibility >> between FMS14 and FX.php, but I have started to receive questions about >> compatibility. Rather than wait for me to get around to a hardware >> upgrade (up to my ears in alligators right now...), I have a few >> questions for all y'all: >> >> 1) Has anyone tested FMS14 with FX.php? >> >> 2) For anyone who has, any particular observations, gotchas, etc.? >> >> 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is >> still fixed in FMS14? >> >> Thanks! > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > From garyfrieders at sonic.net Fri Jul 24 20:40:42 2015 From: garyfrieders at sonic.net (Gary Frieders) Date: Sat Jul 25 19:24:46 2015 Subject: [FX.php List] Re: FX.php_List Digest, Vol 129, Issue 15 In-Reply-To: <20150720014409.496CE1B238A2@mail.iviking.org> References: <20150720014409.496CE1B238A2@mail.iviking.org> Message-ID: <84E55492-4E05-4D36-931F-40EC1B7F2115@sonic.net> I finally got around to this fix. Finally got it working after pulling my hair out trying to get FMS14 to work on a mini-mac. I think the mini-mac is bad. So I tried a iMac for temporary service. FMS14 worked. Next step was getting FX fixed per below. SUCCESS - initially on a database and web site. Now just have to move all the databases over to the temp iMac and run FMS14 for a bit on all the web sites. Will do that next day or two. Thanks for your help. Gary Frieders > On Jul 19, 2015, at 6:44 PM, fx.php_list-request@mail.iviking.org wrote: > > Send FX.php_List mailing list submissions to > fx.php_list@mail.iviking.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.iviking.org/mailman/listinfo/fx.php_list > or, via email, send a message with subject or body 'help' to > fx.php_list-request@mail.iviking.org > > You can reach the person managing the list at > fx.php_list-owner@mail.iviking.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of FX.php_List digest..." > > > Today's Topics: > > 1. FMS 13 (Dale Bengston) > 2. RE: FX.php_List Digest, Vol 129, Issue 11 (Ness, David) > 3. Re: FileMaker Server 14 and FX.php (Troy Meyers) > 4. RE: FileMaker Server 14 and FX.php (Fitzgerald, Theodore C) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 15 Jul 2015 16:38:15 -0500 > From: Dale Bengston > Subject: [FX.php List] FMS 13 > To: "FX.php Discussion List" > Message-ID: <008DECCA-93B3-4E28-9AE4-9031F5FC9CA0@gmail.com> > Content-Type: text/plain; charset="utf-8" > > Here is Chris? message from June 18. > >> Begin forwarded message: >> >> From: Chris Hansen >> Subject: Re: [FX.php List] FMS 13 >> Date: June 18, 2015 at 11:57:28 AM CDT >> To: "FX.php Discussion List" >> Reply-To: "FX.php Discussion List" >> >> Dale, >> >> I just helped someone with this the other day. One difficulty is that after moving FX.php to github, I stopped being careful about updating the version numbering (I've repented, and the current development branch is version 6.9). Anyway, here are the things we did to get the other install working: >> >> 1) Grabbed the latest production version from github, and installed it. >> >> 2) After doing the above, there was an authentication error. We fixed that by finding the curl_setopt() call dealing with CURLOPT_HTTPAUTH and changing the value from CURLAUTH_BASIC to CURLAUTH_ANY, or vice versa. (I am making this a simpler tweak in the development version of FX.php.) >> >> 3) Finally, when looking at the XML path being output during debugging, I noticed that the path was for version 6 and earlier of FileMaker (for whatever reason it was defaulting to that), so we added the FileMaker version explicitly. I expect this last one won't be a problem for you, but just in case... >> >> Hope this helps. I'm currently working on some long overdue polishing, etc. that should make dealing with things like this easier. >> >> Best, >> >> --Chris >> > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/9469358a/attachment-0001.html > > ------------------------------ > > Message: 2 > Date: Wed, 15 Jul 2015 21:38:50 +0000 > From: "Ness, David" > Subject: RE: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 > To: FX.php Discussion List > Message-ID: > > > Content-Type: text/plain; charset="utf-8" > > It works fine for me also, and I am currently using both FMSv13 & FMSv14. > I?m using fx.PHP v6. > > $query = new FX( $serverIP, $webCompanionPort, $dataSourceType, $scheme ); > > Where: > $webCompanionPort = 80; > $scheme = 'http'; // or ?https? as needed > $dataSourceType = 'FMPro7'; > > With regard to Bob?s recommendation #1 below, I think it?s best to just not use filename extensions. fx.php doesn?t need them, and once removed you never have to worry about an extension change in the future. > > > > David Ness > FileMaker & Web Applications Developer > > Bonded Builders Warranty Group > St. Petersburg, Florida USA > 800-749-0381 x4923 > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Bob Patin > Sent: Wednesday, July 15, 2015 5:25 PM > To: FX.php Discussion List > Subject: Re: [FX.php List] FX.php_List Digest, Vol 129, Issue 11 > > Gary, > > It works fine (I use it on my site and elsewhere); a couple of things though: > > 1) if you use extensions in your database name, make sure it?s changed to fp7; > 2) make sure you have the latest version of FX, because earlier ones aren?t going to work. > > > Bob Patin > Longterm Solutions > bob@longtermsolutions.com > 615-333-6858 > FileMaker 9, 10, 11, 12 & 13 Certified Developer > http://www.longtermsolutions.com > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150715/4b8a7d0f/attachment-0001.html > > ------------------------------ > > Message: 3 > Date: Sun, 19 Jul 2015 08:10:41 -0700 > From: Troy Meyers > Subject: Re: [FX.php List] FileMaker Server 14 and FX.php > To: FX.php Discussion List > Message-ID: <187BC6FA.2A35.4356.BE89.7A59C1A785A0@111.1268501> > Content-Type: text/plain; charset="utf-8" > > Chris, > > Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. > > I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. > > I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. > > I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. > > Am I wrong? > > -Troy > > > >> Hey Folks, >> >> I'm going to have to update my server hardware to test compatibility >> between FMS14 and FX.php, but I have started to receive questions about >> compatibility. Rather than wait for me to get around to a hardware >> upgrade (up to my ears in alligators right now...), I have a few >> questions for all y'all: >> >> 1) Has anyone tested FMS14 with FX.php? >> >> 2) For anyone who has, any particular observations, gotchas, etc.? >> >> 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is >> still fixed in FMS14? >> >> Thanks! > > > > ------------------------------ > > Message: 4 > Date: Mon, 20 Jul 2015 01:44:01 +0000 > From: "Fitzgerald, Theodore C" > Subject: RE: [FX.php List] FileMaker Server 14 and FX.php > To: FX.php Discussion List > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > Troy, > > I looked at this a while ago and in my initial testing, it seemed to be fixed...however; I just did a bit more in depth testing and it looks like I may have been premature in declaring this fixed. I think the layout I looked at originally had empty portals, but they were at the end of the query / code, so it appeared to work fine. If the first portal is empty, some of the page works fine, but other parts are messed up. > > I also took a look at 13.v09 again and it also does not appear to be fixed as some others had reported (myself included). > > Ted > ________________________________________ > From: fx.php_list-bounces@mail.iviking.org [fx.php_list-bounces@mail.iviking.org] on behalf of Troy Meyers [tcmeyers@troymeyers.com] > Sent: Sunday, July 19, 2015 10:10 AM > To: FX.php Discussion List > Subject: Re: [FX.php List] FileMaker Server 14 and FX.php > > Chris, > > Today I tried to set up a test web server with the newest version FX connecting to a test FMS 14, and at first trial everything seemed fine, but then I ran into a page that referenced a layout with an EMPTY PORTAL, and again I find that "fmalt" instead of "FMPro7" is required for the page to operate properly. > > I was the first, or at least an early one, to report this issue way back when it first cropped up in FMS 12 (I think that's when it was) so I'm pretty familiar with it. > > I know some folks reported that "FMPro7" was working with server 14, but maybe they didn't have any empty portals. I didn't see it until I hit a record like that. > > I don't think they've kept it fixed (if they actually had, in FMS13, which I didn't try), I'm pretty sure it's not fixed now in 14. > > Am I wrong? > > -Troy > > > >> Hey Folks, >> >> I'm going to have to update my server hardware to test compatibility >> between FMS14 and FX.php, but I have started to receive questions about >> compatibility. Rather than wait for me to get around to a hardware >> upgrade (up to my ears in alligators right now...), I have a few >> questions for all y'all: >> >> 1) Has anyone tested FMS14 with FX.php? >> >> 2) For anyone who has, any particular observations, gotchas, etc.? >> >> 3) Also, has anyone tested to see whether the XML bug fixed in FMS13 is >> still fixed in FMS14? >> >> Thanks! > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > > ------------------------------ > > _______________________________________________ > FX.php_List > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > > End of FX.php_List Digest, Vol 129, Issue 15 > ******************************************** > From jonathan at exit445.com Mon Jul 27 09:34:01 2015 From: jonathan at exit445.com (Jonathan Schwartz) Date: Mon Jul 27 09:34:06 2015 Subject: [FX.php List] Timing is everything Message-ID: They say that "timing is everything.? This happened on Saturday, just below my 18th floor room (I left Thursday). Everyone get out of there before Saturday? http://sanfrancisco.cbslocal.com/2015/07/25/fire-breaks-out-at-rooftop-pool-of-las-vegas-strip-hotel/#.VbXQmlQ0oA0.mailto Jonathan Schwartz jonathan@exit445.com