Welcome Guest, Not a member yet? Register   Sign In
The problem with the transmission of the value of the variable in the model
#1

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();

 } 
Reply
#2

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='' )
Reply
#3

(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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB