我正在运行wordpress 4.9.6,并且正在使用mysql数据库,并创建了一个可通过cron-job数据插入的插件。在我的开发环境中,一切看起来都很好,但是当我将其部署到生产环境时,出现以下错误:
查询INSERT INTO
wp_Market_api
的WordPress数据库错误 ({coin
,id_Market
,tag
,algorithm
,block_time
,block_reward
,block_reward24
,last_block
,difficulty
,difficulty24
,nethash
,exchange_rate
,exchange_rate24
,exchange_rate_vol
,exchange_rate_curr
,market_cap
,estimated_rewards
,estimated_rewards24
,btc_revenue
,btc_revenue24
,profitability
,profitability24
,lagging
,timestamp
,created_at
,updated_at
)值('Verge-Lyra2REv2', '217','XVG','Lyra2REv2','150','730','730','2294046', '17609.20111029','13045.604429967','504206285849','3.86E-6', '3.8173765867419E-6','378.72320717','BTC','364,405,665.20', '11 .03276','14.89208','0.00004259','0.00005748','9','13','', '2018-06-25 18:39:22','2018-06-25 18:40:02','2018-06-25 18:40:02') 由do_action_ref_array,WP_Hook-> do_action, WP_Hook-> apply_filters,call_user_func_array, MarketAPI-> updateMarketAPI
我正在创建结果对象$res
,然后将其放入数据库:
$wpdb->insert("{$wpdb->prefix}market_api", $res);
任何建议对我的查询有何影响?除了我的php_error.log
的上述输出之外,我没有其他输出。
此外,当我手动运行查询时,它会正确插入数据库中。
感谢您的答复!
更新
在表格的结构下方查找:
CREATE TABLE `wp_Market_api` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`coin` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`id_Market` bigint(20) NOT NULL,
`tag` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`algorithm` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`block_time` decimal(15,6) NOT NULL,
`block_reward` decimal(15,6) NOT NULL,
`block_reward24` decimal(25,18) NOT NULL,
`last_block` decimal(20,3) NOT NULL,
`difficulty` decimal(25,5) NOT NULL,
`difficulty24` decimal(25,5) NOT NULL,
`nethash` decimal(25,5) NOT NULL,
`exchange_rate` decimal(20,11) NOT NULL,
`exchange_rate24` decimal(25,22) NOT NULL,
`exchange_rate_vol` decimal(27,18) NOT NULL,
`exchange_rate_curr` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`market_cap` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`estimated_rewards` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`estimated_rewards24` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`btc_revenue` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`btc_revenue24` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`profitability` decimal(10,0) NOT NULL,
`profitability24` decimal(10,0) NOT NULL,
`lagging` tinyint(1) DEFAULT NULL,
`timestamp` datetime NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=163 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci