In a part of my project, I have a page that allows administrators to update many records at once. For example, an administrator may choose something from drop-down boxes similar to this:
Update all records where: (Select a Value from a drop-down box)
equals: (input value 1)
and change: (Select a Value from a drop-down box)
to: (input value 2)
Let's say an administrator chooses to change the Title value for all the employees whose last name is Thomas.
Update all records where: Last Name (a drop-down selected value)
equals: Thomas (input value)
and change: Title (a drop-down selected value)
to: Janitor (input value)
Really, the query syntax is iterated in what I state above:
Update all records where blank equals blank and change blank to blank...
This makes it easy for administrators to update many records at once...
My current query syntax is:
// department is a session variable
$sql = "SELECT * from EMPLOYEE_INFO SET '".$option2.'"='".$input_value2."' WHERE dept='".$_SESSION[department]."' AND '".$option1."' = '".$input_value1."' ";
I am stuck at this point, and I am not able to make updates on any records based on this query. Any and all help is appreciated!
Thanks! Mike