BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >


> Dynamic OE - Databases, etc
  New Posts New Posts RSS Feed - how to change the path dynamically according to?
  FAQ FAQ  Forum Search   Register Register  Login Login

how to change the path dynamically according to?

 Post Reply Post Reply Page  <123
Message Reverse Sort Order
djju1029 View Drop Down
Senior Member
Senior Member

Joined: 02 Août 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2017 at 20:45
Hi OE Team,

I create mydb.php include it into the header of BaseLayer.
The path of db is written as:

$db = new PDO('sqlite:../Data/Local_previs_DB/nmu.db');
        $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

However, some page could not load the db because its location is different depths under index.php with db path.
For example, If test2 page location will be localhost/test/test2.php, then db path should be $db = new PDO('sqlite:../../Data/Local_previs_DB/nmu.db');,but I have no idea how to change the path dynamically according to current page location.

I saw your source. The including_once = "the path of OEDB.php" is changed dynamically according to page location but I couldn't figure out how to do that....

Could you let me know your secret of this?

Many thanks,

Back to Top
 Post Reply Post Reply Page  <123
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,047 seconds.