FileMaker 11 PHP 和 ODBC 换行/回车
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我做了一些测试,发现即使我做了类似
$var1 的事情。序号(10)。 $var2
它无法正常工作。我仔细检查了一下,从 FileMaker 客户端中输入时,字段中的回车符是 ASCII 字符 10 (\n
)。这就是我解决问题的方法。我编辑了记录以插入
'12
。然后,我在 FileMaker 中为要设置为自动输入计算的字段设置字段定义。我的字段名为34'
TestField
,因此我的计算结果为Substitute( TestField; "
。确保取消选中"; ¶ )
不替换现有值
复选框。完成此操作后,使用'12
作为在34'
12
和34< 之间放入回车符的字符串来编辑 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 calledTestField
, so my calculation turned out to beSubstitute( TestField; "<br>"; ¶ )
. Make sure you uncheck theDo 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 the12
and the34
.当遇到同样的问题时,在谷歌上浏览了这个页面。不想尝试使用自动输入 cal 选项,因此仅使用 php 进行操作...
此外,从具有回车符的 FileMaker 字段中提取值时,将其放入变量并返回时需要小心进入 FileMaker。例如:
将其拉入 php 变量:
并将其放回 FileMaker:
此致
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...
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:
and to put it back into FileMaker:
Regards
中断必须位于它自己的双引号中,如下所示:
或:
The break has to be in it's own double quote like this:
or:
今天在使用 Filemaker 和 Java JDBC 时遇到了这个问题。这是可能对其他人有帮助的解决方案。
Ran into this issue with Filemaker and Java JDBC today. Here's the solution which may of help to others.