FileMaker 11 PHP 和 ODBC 换行/回车

发布于 2024-11-01 01:04:55 字数 436 浏览 6 评论 0原文

我正在使用 ODBC 连接连接到 FileMaker Pro 11 Server。我正在从 eBay API 导入一些信息。

当我从 eBay 收到地址时,它有两个字段:地址 1 和地址 2。在 FileMaker 数据库中,我们只有一个地址字段。我试图用 PHP 换行符或回车符分隔两个地址,但它似乎永远不起作用。

我会尝试插入:

"$var1\n$var2"

FileMaker 会将 \n 作为普通文本读取。 \r 也是如此。我也尝试使用以下方式设置字符串:

<<<EOF 

也没有成功。我还尝试了我读到的饼图符号适用于换行符,但它不能以这种方式工作。

所以基本上..如何插入 filemaker 能够理解的 php pdo 和 odbc 换行符?

I am connecting to FileMaker Pro 11 Server with a ODBC Connection. I am importing some information from the eBay API.

When I recieve the address from ebay, it comes in two fields address1 and address2. In the FileMaker database we just have one field for address. I am trying to separate the two addresses with a line break or carriage return with PHP but it never seems to work.

I would try to insert:

"$var1\n$var2"

and FileMaker will read the \n as normal text. Same goes for \r. I have also tried setting the string with:

<<<EOF 

with no success either. I also tried the pie symbol that I read works for line breaks but it does not work in this manner.

So basically.. how can I insert a line break that filemaker will understand with php pdo and odbc?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

倾城月光淡如水﹏ 2024-11-08 01:04:55

我做了一些测试,发现即使我做了类似 $var1 的事情。序号(10)。 $var2 它无法正常工作。我仔细检查了一下,从 FileMaker 客户端中输入时,字段中的回车符是 ASCII 字符 10 (\n)。这就是我解决问题的方法。

我编辑了记录以插入 '12
34'
。然后,我在 FileMaker 中为要设置为自动输入计算的字段设置字段定义。我的字段名为 TestField,因此我的计算结果为 Substitute( TestField; "
"; ¶ )
。确保取消选中不替换现有值复选框。完成此操作后,使用 '12
34'
作为在 1234< 之间放入回车符的字符串来编辑 PHP 字段/代码>。

I did some testing, and found that even if I did something like $var1 . ord( 10 ) . $var2 it wasn't working correctly. I did double-check and the carriage return in a field when typed in from within the FileMaker client is ASCII char 10 (\n). So here's how I solved it.

I edited the record to insert '12<br>34'. Then I set the field definition within FileMaker for the field I was setting to auto-enter a calculation. My field was called TestField, so my calculation turned out to be Substitute( TestField; "<br>"; ¶ ). Make sure you uncheck the Do not replace existing value checkbox. Once I did that, editing the field from PHP using '12<br>34' as the string put in a carriage return between the 12 and the 34.

戏剧牡丹亭 2024-11-08 01:04:55

当遇到同样的问题时,在谷歌上浏览了这个页面。不想尝试使用自动输入 cal 选项,因此仅使用 php 进行操作...

    $var1 . char( 13 ) . $var2  

此外,从具有回车符的 FileMaker 字段中提取值时,将其放入变量并返回时需要小心进入 FileMaker。例如:

将其拉入 php 变量:

    $variable = nl2br($record->getField("field1"));

并将其放回 FileMaker:

    $record->setField('field1',str_replace('<br />',chr(13),$variable));

此致

Ran across this page on google when having the same problem. Didn't want to try using the auto-enter cal option so got it going with php alone...

    $var1 . char( 13 ) . $var2  

Also when pulling a value out of FileMaker field that has carriage returns you need to be careful when you put it into a variable and back into FileMaker. For example:

To pull it into a php variable:

    $variable = nl2br($record->getField("field1"));

and to put it back into FileMaker:

    $record->setField('field1',str_replace('<br />',chr(13),$variable));

Regards

糖粟与秋泊 2024-11-08 01:04:55

中断必须位于它自己的双引号中,如下所示:

$var1 . "\n" . $var2

或:

'var1' . "\n" . 'var2'

The break has to be in it's own double quote like this:

$var1 . "\n" . $var2

or:

'var1' . "\n" . 'var2'
誰ツ都不明白 2024-11-08 01:04:55

今天在使用 Filemaker 和 Java JDBC 时遇到了这个问题。这是可能对其他人有帮助的解决方案。

Character ch = new Character('\n');                    
String dataForFM = "Field Data Here" + ch.toString() + "More Field Data Here";

Ran into this issue with Filemaker and Java JDBC today. Here's the solution which may of help to others.

Character ch = new Character('\n');                    
String dataForFM = "Field Data Here" + ch.toString() + "More Field Data Here";
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文