maxim Posted May 17, 2007 Share Posted May 17, 2007 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/51852-oop-includes-and-sqlite/ Share on other sites More sharing options...
maxim Posted May 17, 2007 Author Share Posted May 17, 2007 i fixex the problem by useing and absolute path to the sqlite db. eg c:\model\database.sqlite. im also now using PDO instead of direct sqlite calls. Quote Link to comment https://forums.phpfreaks.com/topic/51852-oop-includes-and-sqlite/#findComment-255656 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.