Welcome Guest, Not a member yet? Register   Sign In
Model return id record
#1

(This post was last modified: 06-30-2019, 07:10 AM by Nome.)

What are the ways to return the id of the created record in the table?

PHP Code:
  public function insertAny($title$slug) {
    $this->table('node')->protect(false)->place([
      'title'    => $title,
      'slug'     => $slug
    
])
    return ID of record? ;
  

Because I have only one idea, this is to create an additional unique field on which, after executing the record, perform a search and return the ID. But I think there should be some solution out of the CI box.

P.S
Thank for your attention!
Reply


Messages In This Thread
Model return id record - by Nome - 06-30-2019, 07:08 AM
RE: Model return id record - by InsiteFX - 06-30-2019, 03:04 PM
RE: Model return id record - by MGatner - 07-02-2019, 06:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB