1

My tid is autoincrementing, i want to get that tid. or I want to get the last inserted row. I need to use this tid in another table. Please help me

class Transaction extends Model
{

    protected $table = 'tbl_transaction';
    public function UserTrasaction($data)

     {

          $returnData     =   array('status'=>false);



        $this->email                    =   $data['email'];
        $this->tran_status              =   $data['tran_status'];
        if($this->save()) 
        {


            $insertedId = $details->tid;
            echo $insertedId;
                exit($insertedId);

                $returnData['error'] = false;
                $returnData['message'] = "Transaction Success";
                $returnData['status'] = true;
        }   
    }       
}   
Visal Varghese
  • 436
  • 5
  • 14

0 Answers0