Welcome Guest, Not a member yet? Register   Sign In
Insert-or-update function
#3

Additionally, if you do push it through to the database, you need to ensure that whatever method you use will be available wherever your code will run, and consider maintenance if your application will be around for a while.

Something else worth considering might be to make the $id the second parameter in your set_settings() method and make it optional. Then, if you don't have an $id you can skip the query and go straight to insert (assuming you have no other data which could retrieve the existing row for you).
Reply


Messages In This Thread
Insert-or-update function - by Rashid - 09-08-2015, 09:20 AM
RE: Insert-or-update function - by RobertSF - 09-08-2015, 11:14 AM
RE: Insert-or-update function - by mwhitney - 09-08-2015, 11:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB