What is best way to achieve following:
class abc
{
function xyz()
{
$PDO->Query(); //run any query
}
}
Don't want to make connection on every PDO query/operation.
How can we make DB connection to achieve above, using public function, class or something else.
Thanks.
I need to update it.
Don't want to make connection in same class. Connection need to be imported from other class/function. This class abc must not make connection. DB connection come from other class or public function or any other good approach, thats exactly what I am looking for.