I've got a CLI script that processes flat files and puts the contents into a mysql db. I'm trying to utilize the mysqli and having some problems. In the past I would have an app structure something like:
myscript.php - main script
class.dbaccess.php - dbaccess class
class.processor.php - class to handle files
my main file would then create a db connection using the dbaccess class and then the app would make mysql function calls. So for instance the app would just call mysql_query("somequery) within the processor class. This would work because the main app has included both these files and the mysql connection was created in the myscript.php core.
Right or Wrong, this methodology has worked for me years. Now I am attempting to use the mysqli functionality. The problem is that I can create a mysqli object or use it procedurally. Either way, it requires a link back to the connecting object or link.
What kind of architecture layout and implementation are other people using for these kinds of scenarios?