angeloghiotto Posted May 11, 2012 Share Posted May 11, 2012 class links{ private $mysqli; function __construct(){ $this->mysqli = new mysqli('localhost', 'xxxx', 'xxxx', 'xxxx'); } function foo(){ $this->mysqli->query("BLA BLA BLA"); } function foo2(){ $this->mysqli->query("BLA BLA BLA"); } } Is there a problem to decalre the var mysqli , create a new object and use it for whole class ? Quote Link to comment https://forums.phpfreaks.com/topic/262427-help-my-class-is-rigth-contrsuted/ Share on other sites More sharing options...
angeloghiotto Posted May 11, 2012 Author Share Posted May 11, 2012 Miss post, sorry... Quote Link to comment https://forums.phpfreaks.com/topic/262427-help-my-class-is-rigth-contrsuted/#findComment-1344898 Share on other sites More sharing options...
requinix Posted May 12, 2012 Share Posted May 12, 2012 No... That's kinda the point. Quote Link to comment https://forums.phpfreaks.com/topic/262427-help-my-class-is-rigth-contrsuted/#findComment-1344914 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.