$cn = mysql_connect("localhost","root",""); mysql_select_db("yotoco", $cn); $query = mysql_query("UPDATE invitacion SET ".$campo." = '".$value."' WHERE id = '".$id."'");