I've got some issue and don't think i can handle it myself. So, I'm
making CMS and dont really know how to deal with mysqli database
object. For instance, shall i do it this way:
global $db;
class foo {
public function __construct() {
$db->query ...
}
}
Or create each time new object:
class foo {
public function __construct() {
$db = new mysqli(...);
$db->query..
}
}
I'd like to use 1st way, it's much faster, however is that safe?
Yours sincerely skipi.