[英]When i try to run a sql query in magento adminhtml it gives the data, but i'm getting a magento error some where else
This is my code located in app\\design\\adminhtml\\default\\default\\template\\customer\\tab\\addresses.phtml 这是我位于app \\ design \\ adminhtml \\ default \\ default \\ template \\ customer \\ tab \\ addresses.phtml中的代码
$arrParams = $this->getRequest()->getParams();
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$query = 'SELECT entity_id, parent_id, is_active FROM ' . Mage::getSingleton('core/resource')->getTableName('customer_address_entity').'
WHERE parent_id = '.$arrParams['id'];
$results1 = $read->fetchAll($query);
data is correct but when I try to create new customer in the backend it gives an error 数据正确,但是当我尝试在后端创建新客户时出现错误
(SQLSTATE[42000]: Syntax error or access violation: 1064 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)
$arrParams['id'] was the problem. $ arrParams ['id']是问题所在。 It was null at some other location.
在其他位置为空。
Thhanks 谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.