Jump to content

oop / includes and sqlite


maxim

Recommended Posts

long story shot my problem is with PHP5's built in "sqlite_open" function.

 

basically im teaching my self PHP. and after getting to build a complex web site which got messy with procedural programming.

 

to better understand OOP i a using a Model / View / Controller approach. not really using a "framework" at all just doing it my self.

 

now on to the problem.

 

i got 3 folders.  model, View and controller.

 

in my model i have a class that connects to a sqlite database and returns the database handle

 

i have a class im my controller folder that need to manipulate that database so it uses the handle that the model provides. naturally i use includes. to include my model class's

 

but because there is no data base in the controllers folder. the "sqlite_open" creates a NEW database if it cant connect to one. so basically i have a database with no tables. i cant put all my files in the "model" folder it kinda defeats the whole MVC way of thinking.

 

so how where so i got from here ?

 

 

Link to comment
https://forums.phpfreaks.com/topic/51852-oop-includes-and-sqlite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.