php - Shell script erroring out due to supposed MySQL syntax error -
php - Shell script erroring out due to supposed MySQL syntax error -
i've written php script resets customer's password web application (magento):
$write->query("update customer_entity_varchar set value='$password' entity_id=$customer_id , attribute_id in (select attribute_id eav_attribute attribute_code='password_hash' , entity_type=1)");
however, when seek execute shell:
php script.php
it produces next error:
php fatal error: uncaught exception 'pdoexception' message 'sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'and attribute_id in (select attribute_id eav_attribute attribute_code' @ line 1' in /chroot/home/html/lib/zend/db/statement/pdo.php:228
note: variables defined in origin of script did not list them here felt extraneous.
since problem solved comments, here how turned on logging:
i stored query variable: $query
$query = "update customer_entity_varchar set value='$password' entity_id=$customer_id , attribute_id in (select attribute_id eav_attribute attribute_code='password_hash' , entity_type_id=1)"; $write->query($query); $file = 'query.txt'; // open file existing content $current = file_get_contents($file); // append new person file $current .= $query . "\n"; // write contents file file_put_contents($file, $current);
php mysql zend-framework
Comments
Post a Comment