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 ? 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... 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. 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
Archived
This topic is now archived and is closed to further replies.