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

Leo R. Lundgren leo at finalresort.org
Thu Sep 11 11:57:10 MDT 2008


<tip>
As we're speaking about alternatives to Filemaker for some other/real  
database work, I'd just like to point out that there is this "thing"  
in PHP called PDO, which is something of a common database API to use  
for writing faster and more secure code, as well as enabling multiple  
types of databases in the back end. I'm saying this to let any  
newcomers know about it; If they're going to start developing with  
SQL in PHP, they might as well go directly for the good stuff, which  
for example lets one prepare SQL statements, bind attributes to it,  
and then execute the statement with PDO doing input validation (for  
the statement only, not to be confused with common input validation).  
Preparing statements can also give you better performance in cases  
where you run the same query over and over again but with different  
values for the attributes.

Check out http://se.php.net/manual/en/book.pdo.php for more  
information. To clarify; This is something you would use instead of  
for example mysql_query().
</tip>


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

-|



More information about the FX.php_List mailing list