Hi - I have just changed some code but I am frightened to run it as if it doesn't do what I want it to do then it will mess up my whole database.
This UPDATE statement worked fine but I want to limit it to update only certain rows in the database, namely the rows where flex = 'si'.
Will this do that?
$query6 = "UPDATE tenercoche_concesionarios SET tarifa = CASE
WHEN (max3 < 5) THEN \"2\"
WHEN((5 <= max3) AND (max3 < 10)) THEN \"1.8\"
WHEN ((10 <= max3) AND (max3 < 20)) THEN \"1.5\"
WHEN ((20 <= max3) AND (max3 < 50)) THEN \"1.2\"
WHEN ((50 <= max3) AND (max3 < 80)) THEN \"1.1\"
WHEN (80 <= max3) THEN \"1\"
ELSE \"0\"
END;
WHERE flex='si' " ; //This is the line I just added.
$result6 = mysql_query($query6);
Thanks a lot, once again, fall all your amazing help.