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']);
求大神给看看哪错了 展开
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']);
求大神给看看哪错了 展开
1个回答
展开全部
( [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 就知道那个为空了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询