my problem \"is too many connection to MySQL\" because i had created a new object for each function that had needed it.
What is the best solution for this operation? The
I'd say both are bad, pass the $db object in as an argument to the functions:
function test($db) { $db->prepare(...); }