[FX.php List] can you use php to connect to both FileMaker and MySQL simultaneously

Michael Layne fx at 9degrees.com
Mon Apr 17 13:30:23 MDT 2006


Sure,

I have developed a few solutions that talk to both.  Say querying some 
products in a catalog in MySQL, then adding them to a
lineitem PO in FileMaker, etc:

the user selects from a list of POs provided by MySQL.  They select the 
PO and enter a quantity...  then they hit this page that gets all the 
info from MySQL and throws it into a new record in FMSA.

// mysql
    $q = "SELECT * FROM catalog WHERE SKU = '" . $_REQUEST['sku'] . "' 
LIMIT 1"; // query
    $r = mysql_query($q,$connection) or die ("Unable to retrieve 
information from MySQL server: " . mysql_error()); // result
    $dCatalog = mysql_fetch_object($r); // get results into an object

// FX
        $qFX = new FX($ip, $port);
        $qFX->SetDBData($fmdb,$lay);
        $qFX->AddDBParam('sessionID',session_id());
        $qFX->AddDBParam('userID',$_SESSION['uid']);
        $qFX->AddDBParam('vendor',$dCatalog->Vendor);
        $qFX->AddDBParam('vendorName',$vendorNamee);
        $qFX->AddDBParam('agent',$dCatalog->Agent);
        $qFX->AddDBParam('pm',$dCatalog->PM);
        $qFX->AddDBParam('sku',$dCatalog->SKU);
        $qFX->AddDBParam('skuDesc',$dCatalog->SKUDesc);
        $qFX->AddDBParam('labelType',$lblt); // based on logic omitted - 
doesn't relate.
        $qFX->AddDBParam('retail',$retail);
        $qFX->AddDBParam('country',$dCatalog->Country);
        $qFX->AddDBParam('qty',$_POST['qty']);
   
        $rFX = $qFX->FMNew();

we just used the power of MySQL (catalog is 200,000 records) to create a 
single line-item order in FM.

Hope this helps... and Hi Tami!  Long time!  Hope you are well...

Michael

Michael Layne  |  9 degrees 
development  |  www.9degrees.com  |  404.226.7835  |  Skype: LayneBay


Tami Williams wrote:
> Thanks in advance for any help.
>
> Can you use php to connect to both FileMaker and MySQL 
> simultaneously?  Has anyone ever done it?
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "It's better to burn out than to fade away."
>
> Tami Williams
> Creative Computing
> Improve, manage and unify data with custom database and web applications.
> FileMaker and Lasso specialist.
>
> Tel: 770.457.3221
> Fax: 770.454.7419
> E-Mail: tami at asktami.com
> Web: http://www.asktami.com
>
> FileMaker Solutions Alliance Associate | Lasso Professional Alliance 
> Member
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060417/cf02ea4c/attachment.html


More information about the FX.php_List mailing list