Edit Details Forms
Posted: Thu Jul 06, 2006 11:00 am
Hi,
Was just wondering what pattern you guys generally use for making "Edit Forms", where basically the form display's a record in the database (Say a users personal details) and then any changes that are made result in an Update to that record in the database. I think my method at the moment is a bit of hack where the id's of my form elements match the column name in the database, and I have a single function which creates my UPDATE statement dynamically using $key => $value .
This method makes input verfication tricky, however this is not too serious as the current system is only going to be used by my boss
Anyone have any better ways that don't involve using a framework, model or creating a massive class with setEmail(), setName() functions?
Jamie
Was just wondering what pattern you guys generally use for making "Edit Forms", where basically the form display's a record in the database (Say a users personal details) and then any changes that are made result in an Update to that record in the database. I think my method at the moment is a bit of hack where the id's of my form elements match the column name in the database, and I have a single function which creates my UPDATE statement dynamically using $key => $value .
This method makes input verfication tricky, however this is not too serious as the current system is only going to be used by my boss
Anyone have any better ways that don't involve using a framework, model or creating a massive class with setEmail(), setName() functions?
Jamie