External PHP file DB access stops
-
I have an external .php file that resides in my root directory. I have created a link to it and it loads and retrieves data from a MYSQL data base to display in a table just fine.
The problem starts when I add the following into the .php file to make the page look like the rest of my WP site
<? require('wp-blog-header.php'); get_header();
After adding that in I no longer get any data from the MYSQL database that it uses.The page displays but the table is empty.
My database connector is this:require('database.php3'); $db=MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database"); @mysql_select_db("$dbName") OR DIE(error(mysql_error()));
database.php3 holds the variables for accessing the database and all of those variables read correctly. As I have echoed them out and all were shown correctly.
The other issue I am having with this is I included this at the bottom of my .PHP file to include the footer and sidebar. But those 2 items do not display.
get_sidebar(); get_footer();
Anyone have a clue as to why they do not display??
I appreciate any help..
Rick
- The topic ‘External PHP file DB access stops’ is closed to new replies.