Question

I am having a script which makes a db connection and pereform some select operation.accroding to the fetch data i am calling different functions which also perform db operations.How can i pass db connection to the functions which are being called as i donot want to make new connection

No correct solution

OTHER TIPS

Why to pass connection itself? Maybe build a class that handles all the DB-operation and just pass this class' instance around, calling it's methods to perform selects, inserts and all that DB-specific code?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top