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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.