Welcome Guest, Not a member yet? Register   Sign In
variable global
#2

You can do this by setting the table name as a property of that class:

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
M_lideres extends CI_model {

protected 
$table_name "lideres";

 
/*
 * Recupero todos os lideres da tabela.
 * Se for passado o parâmetro ID do lider, então recupero somente um lider
 */
 
function exibe_dados($limite$offset) {

 
$this -> db -> limit($limite$offset);
 
$count $this -> db -> get($this->table_name);
 return 
$count -> result();

 } 

Then change your table references as above to:

PHP Code:
$this->table_name 
Reply


Messages In This Thread
variable global - by pompeu - 04-21-2015, 01:33 PM
RE: variable global - by JayAdra - 04-21-2015, 02:31 PM
RE: variable global - by pompeu - 04-21-2015, 02:46 PM
RE: variable global - by pompeu - 04-21-2015, 03:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB