Subversion Repositories ALCASAR

Rev

Rev 2343 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2343 Rev 2344
Line 92... Line 92...
92
					if (!$res || !da_sql_affected_rows($link,$res,$config))
92
					if (!$res || !da_sql_affected_rows($link,$res,$config))
93
						echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
93
						echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
94
				}
94
				}
95
				else{
95
				else{
96
					if($val != ''){
96
					if($val != ''){
-
 
97
						if (isset($item_vals["$key"][$j])) {
97
						$old_val = $item_vals["$key"][$j];
98
							$old_val = $item_vals["$key"][$j];
98
						$old_val = da_sql_escape_string($link, $old_val);
99
							$old_val = da_sql_escape_string($link, $old_val);
99
						$res = da_sql_query($link,$config,
100
							$res = da_sql_query($link,$config,
100
						"UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND
101
							"UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND
101
						attribute = '$sql_attr' AND value = '$old_val';");
102
							attribute = '$sql_attr' AND value = '$old_val';");
-
 
103
						} else {
-
 
104
							$res = null;
-
 
105
						}
102
					//	if attribute does not exist, we create it.     
106
					//	if attribute does not exist, we create it.     
103
						if (!$res || !da_sql_affected_rows($link,$res,$config))
107
						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);");
108
							$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))
109
						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";
110
							echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";