Jump to content

mountainx

Members
  • Posts

    6
  • Joined

  • Last visited

FileMaker Experience

  • Skill Level
    Novice
  • Application
    16 Advanced

Platform Environment

  • OS Platform
    Mac
  • OS Version
    Sierra

Recent Profile Visitors

1,258 profile views

mountainx's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Well actually, we use this database once a year for a yearly survey so the fieldnames in the survey each year are unique - survey_numberXgroup_numberXquestion_number. So last year's data has absolutely no relevance and get deleted. It may be wrong, but it is the way it was designed. IS that still a no?
  2. What about an existing table? If I deleted the old fields that corresponded to "last year's data", can I append the fields to an already existing table?
  3. I am trying to import data from a MySQL database and need to somehow also import fieldnames to be the fieldname in FMP. Is there anyway to do that? I have a CSV of the fieldnames and I also have a MySQL dump of fieldnames and associated data. Thanks for any help.
  4. Hey all, I have been tasked with a little bit of a problem. PHP is not my primary language, so I'm getting up to speed, and I know little of FileMaker. I understand I need the FileMaker.php and related folder containing the API. I have verified the permissions on Filemaker. i.e. Extended privileges, FMPHP assigned, etc. I have db name, username, password, db server I wanted a simple script that tells me yes/no I am connected to a database. Something like: 1. setup connection (with FileMaker.php require once) 2. Echo yes/no, I am connected to the database, show error info if "no" I searched the forums, and google and have not found something that works in the context of one simple file. I think once I can confirm I can/cannot connect I can begin troubleshooting permissions, etc. Thanks so much in advance for your help! DM
  5. Thanks Dan for your help. Unfortunately adding some extra echos did not reveal anything. I still get the 324 error. For what it's worth, I have moved some sample code into the same directory. When I run listDatabases.php I CAN get the list of databases. However, when I run "compoundFind.php" I get: "Error: Unable to open file" So I can get the LIST of databases. But when I try to access a specific database (in this case the sample database) I am unable to get anything. I just get generic errors that the server closed the page, etc. Any thoughts why this might be happening? Thanks, DM
  6. We have an export job that grabs and worked flawlessly up until an upgrade this last weekend. We upgraded from 10 to 11 and all the subsequent updates. Basically the user specifies a date range on our external website, which then hits the code igniter framework (on the internal web server) to instantiate FileMaker.php and grab the records and serve them back to the external website. Like I said, this all worked well prior to our upgrade over the weekend. I JUST inherited this whole system, I know very little about FileMaker but have been reading and testing. Sample FileMaker code works, is able to list databases. Parts involved: CodeIgniter Framework FileMaker.php Two web servers: Filemaker web server (db.mydomain.net) and client web server (www.mydomain.com) Now, when attempting to perform the export we get a CodeIgniter formatted general error that the connection to the database was closed unexpectedly. In other instance we get Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. Am I missing something obvious? As a FileMaker n00b I'm sure I probably am, but your feedback would be very helpful. I'll seriously paypal you some beer money :-) Here is my controller code (which is unchanged and was working just fine prior to the upgrade: <?php class Paid_calendar extends Controller { protected $fm, $main_menu, $current_only; function __construct() { parent::__construct(); $this->load->helper('file'); $this->load->database(); require_once("FileMaker.php"); $this->fm = new FileMaker('IssueAds Index', 'http://db.mydomain.net' 'phpuseraccount', 'thepassword'); $this->main_menu = new FileMaker('Main Menu', 'http://db.mydomain.net' 'phpuseraccount', 'thepassword'); $this->load->model('Event'); $this->current_only = false; //$this->load->model('photo', '', true); } public function currentOnly(){ $this->current_only = true; $this->index(); } function index() { $issue_data = $this->Event->getCurrentIssue(); $current_issue = $issue_data->display; $this->output->enable_profiler(TRUE); echo "Starting: ".date_create()->format('m-d-Y h:i:s A')."\n"; echo "Issue".$current_issue."\n"; if($current_issue == "16.50" || $current_issue == "16.49"){ $current_issue = "16.51"; } //$layout =& $this->fm->getLayout("Issue Ad Search"); //print_r(array_keys($layout->getFields() ) ); $findCommand =& $this->fm->newFindCommand('Issue Ad Search'); if($this->current_only){ $findCommand->addFindCriterion("Issue ID", "{$current_issue}"); } else{ $findCommand->addFindCriterion("Issue ID", ">={$current_issue}"); } $findCommand->addFindCriterion("Ads::Ad Code ID", '69...99'); //$findCommand->addFindCriterion("cIsActive", 'Active'); $result = $findCommand->execute(); if (FileMaker::isError($result)) { echo "Error: " . $result->getMessage() . "\n"; exit; } echo $result->getFetchCount(); $records = $result->getRecords(); $issues = array(); $ad_codes = array(); $paid_events = array(); foreach ($records as $record) { $out = new StdClass(); $out->is_active = $record->getField("cIsActive"); $out->name = $record->getField("Ads::Field_Headline"); $out->description = $record->getField("Ads::Field_Ad Copy"); $out->ad_code = $record->getField("Ads::Ad Code ID"); $out->issue_display = $record->getField("Issue ID"); //echo $out->issue_display; if(strlen($out->issue_display) == 4){ $out->issue_display .= "0"; } $issue_append = str_replace(".", "", $out->issue_display ); $out->fm_ad_id = $record->getField("Ad ID").$issue_append; $issues[] = $out->issue_display; $ad_codes[] = $record->getField("Ads::Ad Code ID"); $paid_events[] = $out; } $issues = $this->Event->getIssueInfo($issues); $ad_codes = $this->Event->getAdCodeInfo($ad_codes); foreach($paid_events as $event){ $event->description = str_replace("&lt;", "<", $event->description); $event->description = str_replace("&gt;", ">", $event->description); $event->sub_section_id = $ad_codes[$event->ad_code]; $event->start_date = $issues[$event->issue_display]->start_date; $event->end_date = $issues[$event->issue_display]->end_date; $event->repeat_type = 'daily'; $event->repeat_frequency = 1; $event->paid = 1; $event->all_day = 1; $event->repetition_id = NULL; $event->status = 'approved'; $old_event = $this->Event->exists($event->fm_ad_id); if($event->is_active == false){ if($old_event != false){ $this->Event->delete($old_event); echo "Deleted {$old_event->fm_ad_id}\n"; } continue; } unset($event->ad_code); unset($event->issue_display); unset($event->is_active); // print_r($event); if($old_event != false ){ $this->Event->update($event, $old_event); echo "Updated {$event->fm_ad_id}<br />"; } else{ $this->Event->insert($event); echo "Inserted {$event->fm_ad_id}<br />"; } echo "\n"; } echo "Regenerating Cache Table\n"; echo system("curl -f http://www.mydomain....rateCacheTable"); echo "Cache Table Complete\n"; echo "Complete"; } } /* End of file welcome.php */ /* Location: ./system/application/controllers/welcome.php */
×
×
  • Create New...

Important Information

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