UPDATE address SET
phone = COALESCE(?, phone),
street = COALESCE(?, street),
zip = COALESCE(?, zip),
city = COALESCE(?, city)
This way the SQL is static, can be prepared and if you pass an undef for some field it'll keep the old value. Of course this would not work if you did want to be able to set some fields to NULL, but otherwise this seems to be a nice solution.
P.S.: I have never worked with MySQL so I'm not sure there is a COALESCE() function there. It's supposed to return the first non-NULL parameter.
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature