Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl DBD::mysql从长文本字段中切掉单词_Mysql_Perl - Fatal编程技术网

Perl DBD::mysql从长文本字段中切掉单词

Perl DBD::mysql从长文本字段中切掉单词,mysql,perl,Mysql,Perl,我有一个Wordpress MySQL数据库,我正试图从使用perl的DBD::MySQL中提取一些数据 如果在命令行执行此操作: mysql --raw mydb <<EOF select post_content from wp_posts where ID = 195; EOF 我得到: I guess someone famous enough to have <a href="http://en.wikipedia.org/wiki/Hee_Il_Cho" tar

我有一个Wordpress MySQL数据库,我正试图从使用perl的DBD::MySQL中提取一些数据

如果在命令行执行此操作:

mysql --raw mydb <<EOF

select post_content from wp_posts where ID = 195;
EOF
我得到:

I guess someone famous enough to have <a
href="http://en.wikipedia.org/wiki/Hee_Il_Cho" target="_blank">his own
Wikipedia page</a>worth anyone's consideration.  not familiar with
AIMAA, but they appear to have quite a few affiliated school
(particularly in the UK).
我想某个名人值得任何人考虑。不熟悉
AIMAA,但他们似乎有很多附属学校
(特别是在英国)。
以下是相同的文本,标记了缺少的单词:

I guess someone famous enough to have <a
href="http://en.wikipedia.org/wiki/Hee_Il_Cho" target="_blank">his own
Wikipedia page</a> **is** worth anyone's consideration.  **I'm** not
familiar with AIMAA, but they appear to have quite a few affiliated
school (particularly in the UK).
我想一个有**名气的人**值得任何人考虑**我不是
熟悉AIMAA,但他们似乎有很多附属机构
学校(特别是在英国)。
知道是什么引起的吗?post_的内容很长。表格排序规则为utf8\U general\U ci


这种模式在整个文本中持续-缺少单词。所有的帖子都会出现这种情况。

结果是嵌入了一些八进制240。这把输出弄得乱七八糟。我做了一个od-c,看到了他们

移除它们很容易:

$content =~ s/\xa0/ /g;

您执行的两个查询是不同的。我并不是说这就是问题所在,只是如果您对这两个问题使用完全相同的查询,那么故障排除就更容易了。
I guess someone famous enough to have <a
href="http://en.wikipedia.org/wiki/Hee_Il_Cho" target="_blank">his own
Wikipedia page</a> **is** worth anyone's consideration.  **I'm** not
familiar with AIMAA, but they appear to have quite a few affiliated
school (particularly in the UK).
$content =~ s/\xa0/ /g;