mysql根据uid更新数据报错

0

sql语句:


    self::$db->update('dj_equipment')->cols(array('onLine'))->where('uid='.$uid)->bindValue('onLine', 1)->query();
报错信息:
PDOException: SQL:UPDATE `dj_equipment` SET `onLine` = :onLine WHERE uid=DJ_5e78b3cf60813 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'DJ_5e78b3cf60813' in 'where clause' in /root/GatewayWorker/vendor/mysql-master/src/Connection.php:1770
堆栈信息:
Stack trace:
#0 /root/GatewayWorker/vendor/mysql-master/src/Connection.php(1828): Workerman\MySQL\Connection->execute('UPDATE `dj_equi...', Array)
#1 /root/GatewayWorker/Applications/YourApp/Events.php(59): Workerman\MySQL\Connection->query()
#2 [internal function]: Events::onMessage('7f0000010b54000...', '{"type":"bind",...')
#3 /root/GatewayWorker/vendor/workerman/gateway-worker/src/BusinessWorker.php(403): call_user_func('Events::onMessa...', '7f0000010b54000...', '{"type":"bind",...')
#4 /root/GatewayWorker/vendor/workerman/workerman/Connection/TcpConnection.php(657): GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#5 /root/GatewayWorker/vendor/workerman/workerman/Events/Select.php(292): Workerman\Connection\TcpConnection->baseRead(Resource id #42)
#6 /root/GatewayWorker/vendor/workerman/workerman/Worker.php(2401): Workerman\Events\Select->loop()
#7 /root/GatewayWorker/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#8 /root/GatewayWorker/vendor/workerman/workerman/Worker.php(1534): GatewayWorker\BusinessWorker->run()
#9 /root/GatewayWorker/vendor/workerman/workerman/Worker.php(1364): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#10 /root/GatewayWorker/vendor/workerman/workerman/Worker.php(1338): Workerman\Worker::forkWorkersForLinux()
#11 /root/GatewayWorker/vendor/workerman/workerman/Worker.php(539): Workerman\Worker::forkWorkers()
#12 /root/GatewayWorker/start.php(39): Workerman\Worker::runAll()
#13 {main}
Worker[17419] process terminated
worker[YourAppBusinessWorker:17419] exit with status 64000
已邀请:

萤火虫

赞同来自:

已解决!

blogdaren - 常年游走于 Linux、PHP、C、VIM 之间【http://www.phpcreeper.com】

赞同来自:

where语句改成这个试试:


where("uid='{$uid}'")

要回复问题请先登录注册