Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.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
Php Can';t执行查询:BIGINT无符号值超出范围_Php_Mysql_Error Handling_Cron - Fatal编程技术网

Php Can';t执行查询:BIGINT无符号值超出范围

Php Can';t执行查询:BIGINT无符号值超出范围,php,mysql,error-handling,cron,Php,Mysql,Error Handling,Cron,每10分钟启动一次计划的cron作业后出现以下错误: Output from command /usr/bin/php -q /var/www/html/mydomain/_cron/cron.php .. PHP Notice: Can't execute query: BIGINT UNSIGNED value is out of range in '(`karsi_jiggo`.`user`.`hide_time` - 10)' UPDATE user SET hide_time=(h

每10分钟启动一次计划的cron作业后出现以下错误:

Output from command /usr/bin/php -q /var/www/html/mydomain/_cron/cron.php ..

PHP Notice:  Can't execute query: BIGINT UNSIGNED value is out of range in '(`karsi_jiggo`.`user`.`hide_time` - 10)'
UPDATE user SET hide_time=(hide_time-10), last_visit=last_visit WHERE hide_time>0 in /var/www/html/MyDomain/_include/lib/db.php on line 100

Notice: Can't execute query: BIGINT UNSIGNED value is out of range in '(`karsi_jiggo`.`user`.`hide_time` - 10)'
UPDATE user SET hide_time=(hide_time-10), last_visit=last_visit WHERE hide_time>0 in /var/www/html/MyDomain/_include/lib/db.php on line 100

根据您的输出,您的数据库中似乎有隐藏时间>0但为0的数据 并且隐藏时间<10 您的查询

UPDATE user SET hide_time=(hide_time-10), last_visit=last_visit WHERE hide_time>0
…如果在查询开始时是
5
,则会很高兴地尝试将hide_time设置为
-5
(hide_time>0根据旧值而不是更新值进行选择)


BIGINT UNSIGNED
无法保存负值,因此出现错误。

您的问题是什么?这里是我的cron.php的现场直播,我如何更正它?如果($min%1==0){DB::execute(“更新用户集hide_time=(hide_time-10),last_visit=last_visit WHERE hide_time>0”);最安全的更改方法是将WHERE子句更改为
WHERE hide_time>10
,这样它就不会试图将其转换为负数。
UPDATE user SET hide_time=(hide_time-10), last_visit=last_visit WHERE hide_time>0