Re: Can't access and/or change properties with methods

From: Date: Wed, 04 May 2005 00:39:47 +0000
Subject: Re: Can't access and/or change properties with methods
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5824@lists.php.net to get a copy of this message
On Mon, May 2, 2005 5:18 am, marcus said: > Hi, I'm trying to access and change a property from a class, but without > success.. see: > > <? > //Login.class > class Login > { > var $tabela_de_consulta; > var $coluna_usuario; > var $coluna_senha; > function Login() > { > define(K_ENTER, 65293); > include_once '../classes/Mensagem.class'; > $this->janela = new GtkWindow; > . > . > . > } > function set_tabela_de_consulta($string) > { > $this->tabela_de_consulta = $string; Try adding some error output here to be certain you are doing what you think you are doing. > } > function CheckLogin() > { > //Verifica se o usuário e senha estao corretos > include ('../inc/db_connect.inc'); > $usuario = $this->usuario->get_text(); > var_dump($this->tabela_de_consulta); > $var = pg_query($conn, "select $this->coluna_senha from > $this->tabela_de_consulta where $this->coluna_usuario='$usuario'") > or die("nao foi possivel conectar à base de dados."); > $retorna_sql = pg_fetch_array($var); > $usuario_correto = $retorna_sql['usuario_login']; > $senha_correta = $retorna_sql['usuario_senha']; > } > ?> > > When I try to do: > > $login = new Login(); > $login->set_tabela_de_consulta('usuarios'); > > after that var_dump($this->tabela_de_consulta) on function CheckLogin() > stills returns NULL. -- Like Music? http://l-i-e.com/artists.htm

« previous php.gtk.general (#5824) next »