Posts by Ricardo Silva • 1 point
1 post
-
0
votes4
answers24249
viewsA: What is the right way to connect to the Mysqli database
Using mysqli OO in a Singleton. Returns the connection that is only created if it is used. Avoid passing variable throughout the code. Avoids too much code. function db(): mysqli { static $db; $db…