I'm creating a new observer class and having some problems with the following code.
PHP Code:
function update(&$class, $eventID, $paramsArray = array()) {
global $db;
$ormDProducts = array();
$q = 'select products_id from products_addl_data where orm_d_class >= 1';
$result = $db->Execute(sql);
while(!$result->EOF) {
array_push($ormDProducts, $result->fields['products_id']);
}
etc. etc,….
the error log states there is an error with SQL syntax. but when entering the only SQL used, which is:
'select products_id from products_addl_data where orm_d_class >= 1';
..into my command line window, i do not get any errors but instead get a result.
if instead i manually create the array and fill with product ids, like this
$ormDProducts = array(242, 328);
this class file works.
anyone know why the above code is generating errors??
Bookmarks