Jump to content

Help , my class is rigth contrsuted!?


angeloghiotto

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.