Welcome Guest, Not a member yet? Register   Sign In
Why the $this->find( $id ) is generating error but get()->getRow() is working?
#2

(This post was last modified: 02-01-2020, 10:20 AM by zahhar.)

Check if column that stores primary key in your table is named "id" and indexed as primary key. Otherwise (e.g. name is "some_id") you should define it in your model:

<?php namespace App\Models;
use CodeIgniter\Model;
class UserModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'some_id';
?>
Reply


Messages In This Thread
RE: Why the $this->find( $id ) is generating error but get()->getRow() is working? - by zahhar - 02-01-2020, 05:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB