Ich möchte mit UPDATE einen Wert/mehrere Werte direkt in der Datenbank ändern.
Hier ist der Code, welcher mir die - für die Änderung gewünschten - Datensätze anzeigt.
Code: Alles auswählen
SELECT usr_id,
CONCAT(id1.usd_value, ' ', id2.usd_value) AS name, rol_id, rol_name, CONCAT(id70.usd_value) AS beitrag, YEAR(mem_begin), YEAR(mem_end)
FROM adm_roles, adm_categories, adm_members, adm_users
LEFT JOIN adm_user_data id1 ON id1.usd_usr_id = usr_id
AND id1.usd_usf_id = 1
LEFT JOIN adm_user_data id2 ON id2.usd_usr_id = usr_id
AND id2.usd_usf_id = 2
LEFT JOIN adm_user_data id70 ON id70.usd_usr_id = usr_id
AND id70.usd_usf_id = 70
WHERE rol_id = 73 AND id70.usd_value = '12.00' AND mem_begin <= NOW() AND mem_end > NOW()
AND rol_valid = 1
AND rol_cat_id = cat_id
AND cat_org_id = 1
AND mem_rol_id = rol_id
AND mem_usr_id = usr_id
AND usr_valid = 1
ORDER BY name ASC
Code: Alles auswählen
UPDATE adm_users
SET id70.usd_value = '13.00'
WHERE rol_id = 73 AND id70.usd_value = '12.00' AND mem_begin <= NOW() AND mem_end > NOW()
AND rol_valid = 1
AND rol_cat_id = cat_id
AND cat_org_id = 1
AND mem_rol_id = rol_id
AND mem_usr_id = usr_id
AND usr_valid = 1
Ich bin um jeden Tipp dankbar.
Besten Dank bereits im Voraus.
voumi