gpt4 book ai didi

mysql 仅插入字符串值的一部分

转载 作者:行者123 更新时间:2023-11-29 20:16:56 30 4
gpt4 key购买 nike

MySql (MariaDB) 仅在 TEXT 字段中插入字符串文件内容的一部分。

5.5.52-MariaDB-lubuntu0.14.04.1

文件内容:

1,"NODAÏA 01",0.00,1,0,0,0,1,0,0
2,"NODAÏA 02",0.00,1,0,0,0,1,0,0
3,"NODAÏA 03",0.00,1,0,0,0,1,0,0
....

仅 MySQL 插入:

1, "NODA

这个领域没有更多内容了。

剪切此符号所在的位置:Ï

为什么?

Laravel 将完整文件内容发送到 mysql。

Mysql查询日志:

93 Execute insert into tracking_parsed_data (cash_register_id, api_id, command_id, data_type, report_timestamp_first, report_timestamp_last, received_data, parsed_data, updated_at, created_at) values ('1356', '0', '0', '1', '20160919140001', NULL, '1,\"NODAÏA 01\",0.00,1,0,0,0,1,0,0\r\n2,\"NODAÏA 02\",0.00,1,0,0,0,1,0,0\r\n3,\"NODAÏA 03\",0.00,1,0,0,0,1,0,0\r\n4,\"NODAÏA 04\",0.00,1,0,0,0,1,0,0\r\n5,\"NODAÏA 05\",0.00,1,0,0,0,1,0,0\r\n6,\"NODAÏA 06\",0.00,1,0,0,0,1,0,0\r\n7,\"NODAÏA 07\",0.00,1,0,0,0,1,0,0\r\n8,\"NODAÏA 08\",0.00,1,0,0,0,1,0,0\r\n9,\"NODAÏA 09\",0.00,1,0,0,0,1,0,0\r\n10,\"NODAÏA 10\",0.00,1,0,0,0,1,0,0\r\n11,\"NODAÏA 11\",0.00,1,0,0,0,1,0,0\r\n12,\"NODAÏA 12\",0.00,1,0,0,0,1,0,0\r\n13,\"NODAÏA 13\",0.00,1,0,0,0,1,0,0\r\n14,\"NODAÏA 14\",0.00,1,0,0,0,1,0,0\r\n15,\"NODAÏA 15\",0.00,1,0,0,0,1,0,0\r\n16,\"NODAÏA 16\",0.00,1,0,0,0,1,0,0\r\n17,\"NODAÏA 17\",0.00,1,0,0,0,1,0,0\r\n18,\"NODAÏA 18\",0.00,1,0,0,0,1,0,0\r\n19,\"NODAÏA 19\",0.00,1,0,0,0,1,0,0\r\n20,\"NODAÏA 20\",0.00,1,0,0,0,1,0,0\r\n21,\"NODAÏA 21\",0.00,1,0,0,0,1,0,0\r\n22,\"NODAÏA 22\",0.00,1,0,0,0,1,0,0\r\n23,\"NODAÏA 23\",0.00,1,0,0,0,1,0,0\r\n24,\"NODAÏA 24\",0.00,1,0,0,0,1,0,0\r\n25,\"NODAÏA 25\",0.00,1,0,0,0,1,0,0\r\n26,\"NODAÏA 26\",0.00,1,0,0,0,1,0,0\r\n27,\"NODAÏA 27\",0.00,1,0,0,0,1,0,0\r\n28,\"NODAÏA 28\",0.00,1,0,0,0,1,0,0\r\n29,\"NODAÏA 29\",0.00,1,0,0,0,1,0,0\r\n30,\"NODAÏA 30\",0.00,1,0,0,0,1,0,0\r\n31,\"NODAÏA 31\",0.00,1,0,0,0,1,0,0\r\n32,\"NODAÏA 32\",0.00,1,0,0,0,1,0,0\r\n33,\"NODAÏA 33\",0.00,1,0,0,0,1,0,0\r\n34,\"NODAÏA 34\",0.00,1,0,0,0,1,0,0\r\n35,\"NODAÏA 35\",0.00,1,0,0,0,1,0,0\r\n36,\"NODAÏA 36\",0.00,1,0,0,0,1,0,0\r\n37,\"NODAÏA 37\",0.00,1,0,0,0,1,0,0\r\n38,\"NODAÏA 38\",0.00,1,0,0,0,1,0,0\r\n39,\"NODAÏA 39\",0.00,1,0,0,0,1,0,0\r\n40,\"NODAÏA 40\",0.00,1,0,0,0,1,0,0\r\n41,\"NODAÏA 41\",0.00,1,0,0,0,1,0,0\r\n42,\"NODAÏA 42\",0.00,1,0,0,0,1,0,0\r\n43,\"NODAÏA 43\",0.00,1,0,0,0,1,0,0\r\n44,\"NODAÏA 44\",0.00,1,0,0,0,1,0,0\r\n45,\"NODAÏA 45\",0.00,1,0,0,0,1,0,0\r\n46,\"NODAÏA 46\",0.00,1,0,0,0,1,0,0\r\n47,\"NODAÏA 47\",0.00,1,0,0,0,1,0,0\r\n48,\"NODAÏA 48\",0.00,1,0,0,0,1,0,0\r\n49,\"NODAÏA 49\",0.00,1,0,0,0,1,0,0\r\n50,\"NODAÏA 50\",0.00,1,0,0,0,1,0,0\r\n', NULL, '2016-09-26 15:46:09', '2016-09-26 15:46:09')

如果我这个插入查询在 mysql 工作台上运行,一切正常。

最佳答案

由于我有一个比较不同记录的 key ,所以我还执行了以下操作。

$fileContent = mb_convert_encoding($fileContent, 'UTF-8', 'UTF-8');

现在 ->

1,"NODA?A 01",0.00,1,0,0,0,1,0,0
2,"NODA?A 02",0.00,1,0,0,0,1,0,0
3,"NODA?A 03",0.00,1,0,0,0,1,0,0
...

这样我就可以工作了。现在。

关于mysql 仅插入字符串值的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39703646/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com