简体   繁体   English

当我尝试在magento adminhtml中运行sql查询时,它提供了数据,但是我在其他地方遇到了magento错误

[英]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.

相关问题 当我尝试登录Magento 2管理面板时出现500错误 - Getting a 500 error when I try to login to the Magento 2 admin panel 当我在magento的购物车中添加产品时,出现错误“以下某些产品没有所有必需的选项” - getting error “Some of the products below do not have all the required options” when i add product in cart in magento 我正在尝试在magento的产品页面上显示面包屑,但这给了我一个致命错误 - I'm trying to display breadcrumbs on product page in magento but it gives me a fatal error Magento adminhtml类别选项卡块覆盖错误 - Error on Magento adminhtml category tab block override 当我尝试将数据保存在数据库中时,我在 laravel SplFileInfo::getSize() 中收到此错误 - I'm getting this error in laravel SplFileInfo::getSize() when I try to save the data in database 我尝试查询时SQL语法错误 - Error in SQL syntax when I try a query 当我尝试创建表时,SQL或mariadb给我此错误 - SQL or mariadb gives me this error when I try to create a table Adminhtml 中的 Magento 覆盖失败 - Magento Overwrite in Adminhtml failing 我在magento网站中收到错误消息 - I am getting the error in my magento site Magento adminhtml:“ sendMail”不是功能 - Magento adminhtml: “sendMail” is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM