May 19, 200817 yr I've got a basic insert record script setup that was working when I initially set it up and now I can't get anything out of it. Not an error, not a new record. Here's what I'm working with: <?php include_once('FileMaker.php'); // Open file outside of web root which contains FM credentials. This is for security purposes. $FMCredentialsPath = "C:PATH_TOfmCredentials.xml"; if(!$FMCredentials = simplexml_load_file($FMCredentialsPath)) exit("There was an error opening the credentials file"); $APIUsername = $FMCredentials -> APIUsername; $APIPassword = $FMCredentials -> APIPassword; define('FM_HOST', 'filemaker.ourdomain.com'); define('FM_USER', $APIUsername); define('FM_PASS', $APIPassword); define('FM_FILE', 'Invoices'); $FMSession = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS); $FMDisputeRecordFields = array( 'txn_id' => '123456789', 'txn_type' => 'new_case', 'case_id' => 'PP-123-456', 'case_type' => 'Dispute', 'reason_code' => 'Non-receipt', 'status' => 'Open' ); $FMDisputeRecord = $FMSession -> createRecord('PayPalDisputesDev', $FMDisputeRecordFields); $FMDisputeRecord -> commit(); if (FileMaker::isError($FMDisputeRecord)) { echo $FMDisputeRecord -> getMessage(); $mail -> Subject = 'FileMaker Error Adding New Dispute'; $mail -> Body = "Error: " . $FMDisputeRecord -> getMessage(); $mail -> AddAddress("[email protected]", "Andrew Angell"); $mail -> Send(); } else echo "FM Insert command completely successfuly."; ?> When I run that I'm getting the message that the command completely successfully. When I look at the DB, though, no new record is getting created. When I first wrote this yesterday it was working for me. Any information on what might be going on here would be greatly appreciated. Thanks! Edited May 19, 200817 yr by Guest
May 19, 200817 yr Author Doh! This gets me every single time! Man it's hard to get used to this. I had this all setup and working like I said, and then I did end up adding a new field into the DB and I also added the new field into my script's insert code. However, I did NOT add the new field to the actual layout that I was hitting with this particular script. I don't know why I wasn't getting an error back but I re-write a new script and then I did get a "field not found" error which is when it dawned on me.
Create an account or sign in to comment