79,20 → 79,23 |
continue; |
// if value differs from the sql value then update |
else{ |
if (isset($item_vals["$key"][$j])){ |
if (isset($item_vals["$key"][$j]) && (isset($old_val) && $old_val !='') || $sql_attr=='Filter-Id'){ |
$old_val = $item_vals["$key"][$j]; |
$old_val = da_sql_escape_string($link, $old_val); |
$res = da_sql_query($link,$config, |
"UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND |
attribute = '$sql_attr' AND value = '$old_val';"); |
|
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
if(isset($val) && $val != ''){ |
else{ |
$res = da_sql_query($link,$config, |
"INSERT INTO $table ($query_key,attribute,value $text2) |
VALUES ('$login','$sql_attr','$val' $op_val2);"); |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
} |
} |
} |