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

openElement

> 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
Author
Message Reverse Sort Order
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: Aug 02 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: Feb 01 2017 at 7:45pm
Hi OE Team,

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

<?php
$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,

DJ
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 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.051 seconds.