QUOTE (jicedel @ Jan 9 2008, 11:16 PM)

When I want to change the price for a certain group I have the following
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 'where products_attributes_id = '31'' at line 1
update products_attributes se where products_attributes_id = '31'
A. You are posting in the wrong forum. SPPC has it's own support thread.
B. This is a page that comes with SPPC, so no need to do make any manual changes. The query that gives is an error is triggered by line 45 in that file (admin/attributes_groups.php):
CODE
tep_db_perform(TABLE_PRODUCTS_ATTRIBUTES_GROUPS, $sql_data_array, 'update', "products_attributes_id = '" . (int)$_POST['attribute_id'] . "' and customers_group_id = '" . (int)$customer_group_id . "'");
} // end elseif ($data_array['in_db'] == '1')
The function tep_db_perform is in your admin/includes/functions/database.php which file is not changed by SPPC:
CODE
function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {
reset($data);
if ($action == 'insert') {
$query = 'insert into ' . $table . ' (';
while (list($columns, ) = each($data)) {
$query .= $columns . ', ';
}
$query = substr($query, 0, -2) . ') values (';
reset($data);
while (list(, $value) = each($data)) {
switch ((string)$value) {
case 'now()':
$query .= 'now(), ';
break;
case 'null':
$query .= 'null, ';
break;
default:
$query .= '\'' . tep_db_input($value) . '\', ';
break;
}
}
$query = substr($query, 0, -2) . ')';
} elseif ($action == 'update') {
$query = 'update ' . $table . ' set ';
while (list($columns, $value) = each($data)) {
switch ((string)$value) {
case 'now()':
$query .= $columns . ' = now(), ';
break;
case 'null':
$query .= $columns .= ' = null, ';
break;
default:
$query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
break;
}
}
$query = substr($query, 0, -2) . ' where ' . $parameters;
}
return tep_db_query($query, $link);
}
And now the error is that ' set ' becomes ' se' and the rest after it is mostly gone?
My question: how on earth do you manage to f***k this up?