CodeIgniter Forums

Full Version: The problem with the transmission of the value of the variable in the model
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a problem. I am trying to pass the value of the variable $lider in the model but then I get an error:

PHP Code:
A PHP Error was encountered

Severity
Warning

Message
Missing argument 3 for Wolontariusze_model::pobierz_gdzie(), called in C:\WebServ\httpd\IEM2015\application\controllers\Main.php on line 25 and defined

Filename
models/Wolontariusze_model.php

Line Number
23 
and
PHP Code:
SeverityNotice

Message
Undefined variablelider

Filename
models/Wolontariusze_model.php

Line Number
27 

Why?
Here is my code:

Controller
PHP Code:
$GAMEROOM = array ( 'sekcja' => 'GAMEROOM' );
 
$lider 'LIDER GAMEROOM';
 
$data['sekcja_GAMEROOM'] = $this->Wolontariusze_model->pobierz_gdzie'wolontariusze'$GAMEROOM$lider ); 

Model
PHP Code:
public function pobierz_gdzie$tabela$warunek$lider )
 {

 
$zapytanie $this->db->where$warunek ); 
 
$zapytanie $this->db->or_where'sekcja=' $lider ); 
 
$zapytanie $this->db->get$tabela );
 return 
$zapytanie->result();

 } 
Hi,

I dont know... everything seems to be OK...

Try :
- Call the model directly whithout variables : ...->pobierz_gdzie( 'wolontariusze', array ( 'sekcja' => 'GAMEROOM' ), 'LIDER GAMEROOM' );
- Initialize parameters in the model : public function pobierz_gdzie( $tabela = '', array $warunek, $lider='' )
(02-26-2015, 09:21 AM)aurelien Wrote: [ -> ]Hi,

I dont know... everything seems to be OK...

Try :
- Call the model directly whithout variables : ...->pobierz_gdzie( 'wolontariusze', array ( 'sekcja' => 'GAMEROOM' ), 'LIDER GAMEROOM' );
- Initialize parameters in the model : public function pobierz_gdzie( $tabela = '', array $warunek, $lider='' )

Second option work, thanks Smile