Welcome Guest, Not a member yet? Register   Sign In
return insert id from database insert function
#3

Pass true as the second argument.

PHP Code:
$id $this->db->table('gallery_albums')->insert($datatrue); 

Since there is overhead associated with getting the last inserted ID from many databases, you get a small performance boost by not returning it if you don't need it. So CI4 doesn't return that by default, but makes it easy to get it if you need it.
Reply


Messages In This Thread
RE: return insert id from database insert function - by kilishan - 04-21-2020, 06:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB