Welcome Guest, Not a member yet? Register   Sign In
From and Database Value Comparisons
#2

[eluser]CroNiX[/eluser]
This is easy using the form_helper with form_validation and also set_value('fieldname', $default'), where $default will be your original data from the database which would show up on page load. If the user submits the form and there is a validation error, it will repopulate the form with whatever they entered. No errors, update.

If you try to "update" a database row, but no info actually changes, MySQL will ignore the update. It only actually performs an update if data actually changes. This is much more efficient than running a query to get the old data, checking it against the new data to see if anything changed and if it did, then update.


Messages In This Thread
From and Database Value Comparisons - by El Forum - 10-10-2012, 08:21 AM
From and Database Value Comparisons - by El Forum - 10-10-2012, 11:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB