This topic is locked
[SOLVED]

 using PHPR db connection in custom file

4/19/2012 2:13:58 PM
PHPRunner General questions
W
wildwally author

Wondering what the proper way is to use the connection strings in a custom PHP file.
I have a PHP to EXCEL file I created and want to populate the spread sheet with data from a query, I thought I could use the Global $Conn; but it's not working. Anyone been successful with this or will i need to write out the full connection string?

Sergey Kornilov admin 4/19/2012

The following should be enough to get access to database connection and everything else you might need:

include("include/dbcommon.php");


See example at http://www.asprunner.com/forums/topic/15866-how-to-subscribe-to-database-changes-via-rss/

W
wildwally author 4/19/2012

I did try that and it wouldn't work; realized I wasn't backing out to the right directory. found that problem and got it to work.
Thanks.