Jump to content
Server Maintenance This Week. ×

Upgrading to Filemaker Pro 12 and FX.php


This topic is 3739 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Currently our web pages call Filemaker using the following code:
 
$newregistration = new FX($serverIP,$webCompanionPort);
$newregistration -> SetDBData('Web Registration Information.fp7', 'Web Registration Information');
$newregistration -> SetDBPassword($webPW, $webUN);
 
If we migrate to Filemaker 12 which seems inevitable, do we have to change the database file extension to .fp12 on every php web page?
 
Or does FX.php have a work around that makes this unnecessary?
Link to comment
Share on other sites

I use a connection file. Thus I only have to change this stuff in one place for a site.

 

newFX accepts more parameters than that too - new FX($dbHost,$port,$dbType,$conType);

 

Then the SetDBData only needs ('Filename','Layout') - no need for the .fp7 if you set $dbType in the first place...

 

So, my db_conn.php file looks like:

<?php

    $dbHost='server.address.com';        //Database IP
    $port='80';                        //Webserver Port
    $dbType='FMPro7';                    //For FMPro7
    $conType='HTTP';                    //Connection Type
    $dbUser='user';                    //Database User Name
    $dbPass='password';                    //Database Password
    $dbName='Database_Name';            //Database Name
    
?>
[/code]
 
And my initial connection information might look like:
 
[code]
    include_once('../include/db_conn.php');    // DataBase Configuration File.
    include_once('../include/FX/FX.php');    // FX.php file
    //Base connection information
    $findLOC = new FX($dbHost,$port,$dbType,$conType);
    $findLOC -> setDBPassword($dbPass,$dbUser);
    $findLOC -> setDBData($dbName,'layout');
Link to comment
Share on other sites

Thanks webko - I havent looked at this code in years as it didnt need any changes until Filemaker decided to change the file extension again. I really wish they'd stop adding a numerical version number in the file extension - it would save us all a lot of bother. Thanks again.

Link to comment
Share on other sites

  • 9 months later...
Further to the above a consultant looked at the FX.php code and figured out that all that needs to happen is for "FMPro7" to be replaced with $dataSourceType and then the file extension could be removed from the database filename as follows:
 
BEFORE
 
$Course_Search=new FX($serverIP,$webCompanionPort,'FMPro7');
$Course_Search->SetDBData('Course Information.fp7','Course Information',$groupSize);
$Course_Search->SetDBPassword('fmsadmin','fmsadmin');
 
AFTER
 
$Course_Search=new FX($serverIP,$webCompanionPort, $dataSourceType );
$Course_Search->SetDBData('Course Information','Course Information',$groupSize);
$Course_Search->SetDBPassword('fmsadmin','fmsadmin');
 
Can anyone see a problem with this? The edited web page is calling the .fp7 version of the database. I can't test if it calls the .fmp12 version just yet.
Link to comment
Share on other sites

This topic is 3739 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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