[FX.php List] How different is FX from MySQL

Dale Bengston dbengston at tds.net
Thu Sep 11 15:41:24 MDT 2008


FMFind() works with MySQL simply by setting the second and third  
parameters of your FX instantiation.

$myRecs = new FX($serverIP, $port, $source);

FMP:
$port = 80;
$source = 'FMPro7'; //or whatever

MySQL:
$port = 3306;
$source = 'MySQL';

FX does the rest. It is possible to use the other functions you  
mentioned to construct your own SQL queries, but for basic stuff, it  
works just like FX for FileMaker.

Dale

PS Learning SQL is on my list too, but fortunately I have someone on  
my team who already knows it. Motivation is low!


On Sep 11, 2008, at 4:03 PM, Joel Shapiro wrote:

> COOOOL!!
>
> As someone who couldn't even qualify yet as a SQL ignoramus, I've  
> gotta look into this...
>
> Dale: Do you think looking at the SQL Functions section in  
> FXFunctions.pdf (PerformSQLQuery, SetDataKey, SetSelectColumns,  
> SQLFuzzyKeyLogicOn) will be enough to get me started?  Will using  
> those functions w/ FM-like FX functions allow me to do things like  
> FMFind, FMEdit, FMNew w/ data stored in MySQL?
>
> (& Leo: yes, learning SQL is on my list of things to do... ah, but  
> when? ;-)
>
> Thanks,
> -Joel
>
>
> On Sep 11, 2008, at 1:51 PM, Dale Bengston wrote:
>
>> Correct. I am a SQL ignoramus. But FX does all that heavy lifting!
>>
>> Dale
>>
>>
>> On Sep 11, 2008, at 3:37 PM, Joel Shapiro wrote:
>>
>>> Great.  Then my next question is...
>>>
>>> Does using FX w/ SQL mean I don't need to learn much SQL?
>>>
>>> (how overly optimistic am I?)
>>>
>>> -Joel
>>>
>>>
>>> On Sep 11, 2008, at 12:33 PM, Dale Bengston wrote:
>>>
>>>> FX also works with Postgre. And with ODBC sources as well.
>>>>
>>>> Dale
>>>>
>>>>
>>>> On Sep 11, 2008, at 2:02 PM, Leo R. Lundgren wrote:
>>>>
>>>>> BTW! Look at PostgreSQL as well. It's a /very/ competent  
>>>>> database, and my personal preference.
>>>>>
>>>>> 11 sep 2008 kl. 20.58 skrev Dale Bengston:
>>>>>
>>>>>> A big, loud "Yes!"
>>>>>>
>>>>>> In fact, we have constructed our own PHP platform/framework in  
>>>>>> such a way that we can easily toggle the data source of an  
>>>>>> entire site from MySQL to FileMaker.
>>>>>>
>>>>>> We are doing far more MySQL projects than FileMaker at this  
>>>>>> point. If we are not building into an existing FileMaker  
>>>>>> installation, we almost always choose MySQL. It is around a  
>>>>>> zillion times faster than dragging XML out of FileMaker.
>>>>>>
>>>>>> Dale
>>>>>>
>>>>>> On Sep 11, 2008, at 12:45 PM, Joel Shapiro wrote:
>>>>>>
>>>>>>> Has anybody here ever used FX.php to connect to a MySQL data  
>>>>>>> source?
>>>>>>>
>>>>>>> Chris Hansen has said it's possible, and there's some basic  
>>>>>>> documentation in FXFunctions.pdf
>>>>>>>
>>>>>>> -Joel
>>>>>>>
>>>>>>>
>>>>>>> On Sep 11, 2008, at 10:00 AM, Michael Layne wrote:
>>>>>>>
>>>>>>>> I've spent a lot of time in both as well, and I tend to agree  
>>>>>>>> with Derrick.  With solutions that already exist in FMP, go  
>>>>>>>> for it with FX and get the benefit of PHP, but starting from  
>>>>>>>> scratch (and again, if it's primarily a web-based solution),  
>>>>>>>> I would go with MySQL every time.  As for any learning curve,  
>>>>>>>> there is one if you've never written in SQL, but there are so  
>>>>>>>> many examples, tutorials, even frameworks to help, that your  
>>>>>>>> resources are virtually unlimited.
>>>>>>>>
>>>>>>>> On a more detailed note, you use the FX class and syntax,  
>>>>>>>> etc. to communicate with FM, but once you get your results,  
>>>>>>>> what you do in PHP doesn't have to be wildly different from  
>>>>>>>> what you do after getting your results from a SQL  
>>>>>>>> statement... 2 different queries, but I have one app that  
>>>>>>>> uses MySQL for products, and FM for generating orders with  
>>>>>>>> those products, sometimes all in one file.
>>>>>>>>
>>>>>>>> SQL:
>>>>>>>> 	$q = "SELECT * FROM catalog WHERE vendor = '" .  
>>>>>>>> $_SESSION['vid'] . "'"; // display catalogs to begin product  
>>>>>>>> selection
>>>>>>>> 	$r = mysql_query($q,$connection) or die ("Unable to retrieve  
>>>>>>>> information from MySQL server: " . mysql_error());
>>>>>>>>
>>>>>>>> FX:
>>>>>>>> 	$q = new FX($ip, $port);
>>>>>>>> 	$q->SetDBData($fmdb,$lay);
>>>>>>>> 	$q->AddDBParam('sessionID',session_id()); // grab existing  
>>>>>>>> items from order items table
>>>>>>>> 	$r = $q->FMFind();
>>>>>>>>
>>>>>>>> RESULTS (FX):
>>>>>>>> 	foreach ($r['data'] as $l) {
>>>>>>>> 		// do something...
>>>>>>>> 	}
>>>>>>>>
>>>>>>>> RESULTS (MySQL):
>>>>>>>> 	while ($l = mysql_fetch_assoc($r)) {
>>>>>>>> 		// do something...
>>>>>>>> 	}
>>>>>>>>
>>>>>>>> HTH,
>>>>>>>>
>>>>>>>> Michael
>>>>>>>>
>>>>>>>> Michael Layne  |  9 degrees development  |  9degrees.com  |   
>>>>>>>> skype:laynebay
>>>>>>>>
>>>>>>>> On Sep 10, 2008, at 5:50 PM, Derrick Fogle wrote:
>>>>>>>>
>>>>>>>>> Conversely, I've had almost the opposite experience. Working  
>>>>>>>>> with MySQL as a backend DB to PHP is extremely simple and  
>>>>>>>>> straightforward, and there are some very robust libraries -  
>>>>>>>>> or frameworks - for it. The only thing you lose that makes  
>>>>>>>>> more code in PHP is the fact that the database doesn't do  
>>>>>>>>> calculations for you. I'll take that tradeoff for the speed:  
>>>>>>>>> MySQL is so much faster as a DB than FMP, it's hard to even  
>>>>>>>>> come up with a figure. Think thousands of times faster,  
>>>>>>>>> maybe more.
>>>>>>>>>
>>>>>>>>> FX.php is an invaluable tool and a godsend if you've already  
>>>>>>>>> got something running in FMP and need to extend it to the  
>>>>>>>>> web. But the code is more verbose than MySQL. And with the  
>>>>>>>>> experience I've got in both PHP and FMP, I find it roughly  
>>>>>>>>> equivalent to tackle a logic problem in one vs the other.  
>>>>>>>>> Filemaker's solution always seems to be "yet another field";  
>>>>>>>>> PHP is a much bigger and dynamic sandbox, with some really  
>>>>>>>>> robust functions.
>>>>>>>>>
>>>>>>>>> If I have the need for a workgroup DB that doesn't  
>>>>>>>>> necessarily have to be web-based (i.e. everyone is on the  
>>>>>>>>> same LAN in the same office), I'll pick FMP and extend a few  
>>>>>>>>> small portions to the web with FX.php if needed. But if I  
>>>>>>>>> have an application that needs to be web-based (and that  
>>>>>>>>> means just about any geographically diverse group of users),  
>>>>>>>>> I wouldn't even think of staring in FMP except as a modeling  
>>>>>>>>> tool. It's just too slow, and there's that functionality  
>>>>>>>>> "wall" you hit with FMP that just doesn't exist in a PHP/ 
>>>>>>>>> MySQL web app.
>>>>>>>>>
>>>>>>>>> Just my US $0.00...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sep 10, 2008, at 1:23 PM, John Funk wrote:
>>>>>>>>>
>>>>>>>>>> You do not need FX to connect to MySql.
>>>>>>>>>> There are many sites dedicated to this. PHP and MySQL work  
>>>>>>>>>> very well together.
>>>>>>>>>> My 2 cents: I converted a site from MYSQL to FX/FileMaker  
>>>>>>>>>> and the resulting code is far simpler.
>>>>>>>>>> John Funk
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 9/10/08 1:13 PM, "Josh Shrier" <joshshrier at gmail.com>  
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> I have been offered a couple of projects to do PHP with a  
>>>>>>>>>>> MySQL database. I have become pretty fluent with FX. Can  
>>>>>>>>>>> someone tell me what the learning curve would be from FX  
>>>>>>>>>>> to MySQL.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Josh Shrier
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Derrick
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> FX.php_List mailing list
>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> FX.php_List mailing list
>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> FX.php_List mailing list
>>>>>>> FX.php_List at mail.iviking.org
>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>
>>>>>> _______________________________________________
>>>>>> FX.php_List mailing list
>>>>>> FX.php_List at mail.iviking.org
>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>
>>>>>
>>>>> -|
>>>>>
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list