My form is to update a record, and it has two combo boxes. These you are able to select a program and a item associated with that program, like a task associated with that program. for example, a car manufacturer then a model. I have three text area boxes with details. Since I don't have a handle on ajax yet, the boxes have a place holder value of "Type a new blah or just delete this" where blah is a change to that field, so the old value isn't totally important. Each blah is diffent, so just change blah to another word for the other two text areas.
I need help with putting a query together that looks at each text area and if it isn't that specified value, update that record. I am thinking something like:
Code:
UPDATE myTable
CASE
WHEN (($textarea1 !== "Type a new blah or just delete this") OR ($textarea1 !== NULL)
THEN SET myField = $textarea1
END CASE
CASE
WHEN (($textarea2 !== "Type a new blah2 or just delete this") OR ($textarea1 !== NULL)
THEN SET myField2 = $textarea12
END CASE
CASE
WHEN (($textarea3 !== "Type a new blah3 or just delete this") OR ($textarea1 !== NULL)
THEN SET myField3 = $textarea3
END CASE
WHERE someField1 = $myCombo1 AND someField2 = $myCombo2;