Darkness Soul Posted November 29, 2006 Share Posted November 29, 2006 Yo,I'm trying to start dev with OO, so I'm build up a connection class, but have a question about functions. If I want do the function below, will it record in a variable with the same name as the function or will it work as function return?[code]class conexao (){ var $dados ; function executa ( $comando ) { $this->executa = @mysql_query ( $comando , $this->conexao ) ; }}[/code]Thank you,D.Soul Quote Link to comment Share on other sites More sharing options...
trq Posted November 29, 2006 Share Posted November 29, 2006 No... that will not work. You will need to return the connection resource. eg;[code=php:0]function executa ( $comando ){ return @mysql_query ( $comando , $this->conexao ) ;}[/code] Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted November 29, 2006 Author Share Posted November 29, 2006 Hmm, understood!May I use this post to paste my full class to people help me? I think, I'm studing, and other people checking will help a lot, and don't remember if the rules allow it (going read it again). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.