To do long queries like that, I create an array at the beginning of my save function of all the variables I'm trying to put into a db. So if my form had the fields, firstname, lastname, phone, and favorite color:
$fields = ARRAY("lastname ","phone","favo rite_color");

Then, I build my query string like this:
Code:
$fields = ARRAY("lastname","phone","favorite_color");
...