福乐熊品牌 发表于 2017-10-14 20:56:15

牛人帮帮看看什么情况?数据库不兼容吗?

exception 'Exception' with message 'SELECT COUNT(*) AS num FROM cg_distributor WHERE parent_id = 执行错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' in /home/wwwroot/default/zhonghe/SpeedPHP/spFunctions.php:163 Stack trace: #0 /home/wwwroot/default/zhonghe/SpeedPHP/Drivers/mysql.php(62): spError('SELECT COUNT(*)...') #1 /home/wwwroot/default/zhonghe/SpeedPHP/Drivers/mysql.php(26): db_mysql->exec('SELECT COUNT(*)...') #2 /home/wwwroot/default/zhonghe/SpeedPHP/Core/spModel.php(431): db_mysql->getArray('SELECT COUNT(*)...') #3 /home/wwwroot/default/zhonghe/model/distributor/lib_distributor.php(176): spModel->findSql('SELECT COUNT(*)...') #4 /home/wwwroot/default/zhonghe/controller/front/distributor.php(312): lib_distributor->getNumOfDownDistributor(NULL) #5 /home/wwwroot/default/zhonghe/SpeedPHP/spFunctions.php(21): distributor->distributorCenter() #6 /home/wwwroot/default/zhonghe/index.php(92): spRun() #7 {main}


jake 发表于 2017-10-17 09:21:37

看这里的提示,简单来说就是你的代码里面,某个变量为空

lib_distributor->getNumOfDownDistributor(NULL)

所以在查询数据库的时候出错。
也就是
SELECT COUNT(*) AS num FROM cg_distributor WHERE parent_id = 没有东西所以出错

福乐熊品牌 发表于 2017-10-19 15:53:17

jake 发表于 2017-10-17 09:21
看这里的提示,简单来说就是你的代码里面,某个变量为空

lib_distributor->getNumOfDownDistributor(NULL) ...

谢谢大神提醒,问题已解决
页: [1]
查看完整版本: 牛人帮帮看看什么情况?数据库不兼容吗?