Just wanted to understand that is it a good idea to create a class in PHP which has your connection function?
I tried a bit but realized that i'll have to either include all other functions such as prepare, execute etc in the class itself for it to work or pass the connection object as a parameter every-time i call prepare, execute etc.
What is the best and secure approach for creation a connection to the DB?
Thanks.