You need to tell your model what table to use, most of the CodeIgniter Model parameters
need to be setup in your model. I would open the system/Model.php and take a look at all
the parameters it has to offer.
PHP Code:
<?php namespace App\Models;
use CodeIgniter\Model;
class ParticipantModel extends Model
{
/**
* -------------------------------------------------------------------
* Class properties go here.
* -------------------------------------------------------------------
*
* public, private, protected, static and const.
*/
/**
* Name of database table
*
* @var string
*/
protected $table = 'your_table_name';
public function participants_total()
{
// (some sql query here and return result)
}
}
With that you should be able to use any of the CodeIgniter Model's methods.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )