1
我已经写了我的web应用程序(Magento的)重置客户的密码PHP脚本:当我尝试从shell执行shell脚本示数出因认为MySQL的语法错误
$write->query("update customer_entity_varchar set value='$password'
where entity_id=$customer_id and attribute_id in (select attribute_id from eav_attribute
where attribute_code='password_hash' and entity_type=1)");
然而, :
php script.php
它产生以下错误:
PHP Fatal error: Uncaught exception 'PDOException' with message '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 'and attribute_id in (select attribute_id from eav_attribute where attribute_code' at line 1' in /chroot/home/html/lib/Zend/Db/Statement/Pdo.php:228
注:变量是先前d在脚本开始时就有所定义,但我没有在这里列出,因为我觉得它们是无关的。
你会得到什么,如果你打印整个查询? –
伟大的问题,让我登录并看看。 – sparecycle
也许问题是唯一一个没有引号? entity_id = $ customer_id和 – Matt