ecshop后台订单列表页面想显示省市区报错 5

MySQLservererrorreport:Array([0]=>Array([message]=>MySQLQueryError)[1]=>Array([sql]=>... MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => select region_name from `sheshou`.`ecs_region` where region_id= ) [2] => Array ( [error] => 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 ) [3] => Array ( [errno] => 1064 ) )

admin/order.php sql语句

$row[$key]['province']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$value['province']);
$row[$key]['city']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$value['city']);
$row[$key]['district']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$value['district']);
求大神给看看哪错了
展开
 我来答
激炎吴彩钧0H
2017-06-12 · TA获得超过219个赞
知道小有建树答主
回答量:435
采纳率:50%
帮助的人:105万
展开全部
( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => select region_name from `sheshou`.`ecs_region` where region_id= ) 注意这个egion_id的值为空,涉及到你的sql句子里面$value['province'] $value['city']$value['district']这个里面有空值,或者都为空值,打印下$value 就知道那个为空了
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式