Subversion Repositories ALCASAR

Rev

Rev 2342 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2342 Rev 2343
Line 103... Line 103...
103
						if (!$res || !da_sql_affected_rows($link,$res,$config))
103
						if (!$res || !da_sql_affected_rows($link,$res,$config))
104
							$res = da_sql_query($link,$config,"INSERT INTO $table ($query_key,attribute,value $text2) VALUES ('$login','$sql_attr','$val' $op_val2);");
104
							$res = da_sql_query($link,$config,"INSERT INTO $table ($query_key,attribute,value $text2) VALUES ('$login','$sql_attr','$val' $op_val2);");
105
						if (!$res || !da_sql_affected_rows($link,$res,$config))
105
						if (!$res || !da_sql_affected_rows($link,$res,$config))
106
							echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
106
							echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
107
					}
107
					}
108
					else{
108
					else if (isset($item_vals["$key"][$j])) {
109
					//	if value is empty, we delete this attribute
109
					//	if value is empty, we delete this attribute
110
						$old_val = $item_vals["$key"][$j];
110
						$old_val = $item_vals["$key"][$j];
111
						$old_val = da_sql_escape_string($link, $old_val);
111
						$old_val = da_sql_escape_string($link, $old_val);
112
						if(isset($old_val) && $old_val != '')
112
						if(!empty($old_val))
113
                                                        $res = da_sql_query($link,$config,"DELETE FROM $table WHERE $query_key = '$login' AND attribute = '$sql_attr' AND value = '$old_val';");
113
							$res = da_sql_query($link,$config,"DELETE FROM $table WHERE $query_key = '$login' AND attribute = '$sql_attr' AND value = '$old_val';");
114
                                        }
114
					}
115
				}
115
				}
116
			}
116
			}
117
		}
117
		}
118
	}
118
	}
119
}
119
}