Php FileMaker API,要求我的数据库有几个表

Php FileMaker API,要求我的数据库有几个表,php,sql,web,filemaker,Php,Sql,Web,Filemaker,我正在搜索一种方法,通过FileMaker让我的PHP数据库执行以下操作: 选择* 从mytable、mytable2、mytable3 其中mytable.primar\u key=mytable2.foreign\u key mytable2.foreign_key=mytable3.primar_key 类似于:$findCommand=&$fm->newFindAllCommand('mytable','mytable2'); $findCommand->addFindCriterio

我正在搜索一种方法,通过FileMaker让我的PHP数据库执行以下操作:

选择*
从mytable、mytable2、mytable3
其中mytable.primar\u key=mytable2.foreign\u key
mytable2.foreign_key=mytable3.primar_key

类似于:
$findCommand=&$fm->newFindAllCommand('mytable','mytable2');
$findCommand->addFindCriterion('mytable2.foreign_key','mytable.primar_key')

或者类似于:
$findCommand->executeQuery(“我的查询SQL”)


我在等待您的答案

我不是SQL专家,在FileMaker中很少使用它(但使用频率越来越高),因此我不完全了解您的SQL代码在做什么,但FileMaker确实有一个
ExecuteSQL()
函数,它可能会返回您想要的结果,因此,接下来的问题是如何让PHP API访问该函数


API可以执行FileMaker脚本,FileMaker脚本可以运行SQL查询并将结果存储在全局文本字段中。但是,您将获得结果的文本表示,而不是PHP FileMaker_结果对象,因此您需要自己解析文本并将其转换为有用的形式。

有时处理此类问题的最佳方法是利用FileMaker提供的现成功能

因此,如果有三个相关的表,我会这样做:

  • 基于TableOccurrence1在FileMaker中创建新布局
  • 在新布局上,放置TableOccurrence1、related TableOccurrence2和related TableOccurrence3中所需的所有字段
  • 在php中,基于该布局创建新的搜索
  • 我之所以称这些表为“TableOccurrence1”,是因为您需要确保布局基于与其他两个表具有适当关系的表引用

    $request = $fm->newFindAllCommand('yourNewLayout'); // will give you all records
    $result = $request->execute();
    $records = $result->getRecords();