94,11 → 94,15 |
} |
else{ |
if($val != ''){ |
if (isset($item_vals["$key"][$j])) { |
$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';"); |
} else { |
$res = null; |
} |
// if attribute does not exist, we create it. |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
$res = da_sql_query($link,$config,"INSERT INTO $table ($query_key,attribute,value $text2) VALUES ('$login','$sql_attr','$val' $op_val2);"); |