My issue was resolved, not sure if the connection to the database will work, but the error with wpdb connection was fixed. It was quite easy fix once I found out what the file dependence was. This is what you need to do:
In the file you are trying to use wpdb you need to add code before you can use the class:
<?php require_once('../../../wp-load.php'); ?>
Note* You may need to change how far back in the directory you go depending on your install or depending on the location of your php template/file.
It should run wpdb without any errors.
Related Posts:
- How to insert a single row to WP database table?
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- How to return number of found rows from SELECT query
- $wpdb->delete column values IN ARRAY()?
- WPDB: how to get the value of a field in a custom database table
- Prevent Data Resubmission On Page refresh
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Display fields as values in array from external SQL DB
- Getting id of poll from WP database
- WSoD being caused by this piece of code
- $wpdb->update with multiple parameters gives error
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- Display Data in Table from External Database in WP using Shortcodes
- How to retrieve the data from the sever and displaying it in a page?
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- How to use mysql LIKE with wpdb?
- Delete database record using plugin from admin panel
- Wpdb get->results to out the the month from the db
- How to add data to a custom field at the wp_users table?
- Change MySQL PDO connection to a WPDB connection
- WPDB – Read and write value from / to database
- How to Generate a list of Most Commented post?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- Add posts to custom table in database instead of wp_posts
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Database entry removed on browser refresh, Ajax PHP jQuery
- Change wordpress’ database data using ajax – how to get current user id?
- Create a new account on site B with data from the purchase of site A
- Using wpdb to connect to a different database is not working
- Modify post image in full size
- How to grab data from input and store it into custom table in database?
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Weird Behaviour: Not all WordPress Posts appearing
- How to fetch results from database
- Check if values exists DB
- Querying multiple meta_keys in WordPress SQL query
- MySQL database migration to WordPress
- Fetching wpdb data from a php file seems to break?
- Insert into db with foreach problem
- posts_clauses drop ACF get_field function
- How to get data (not value or name) from radio options to POST to database
- Putting form result in my database
- Trouble getting wpdb to work – first time
- How to make sure relative URL works when site is not on root domain?
- How to add PHP pagination to wordpress
- How to pass hook variable to function?
- Remove submenu item from list
- Get the alt text of the image in a array
- How to prevent a function from running based on host (ie web vs local)?
- Call to a member function get_row() on a non-object, Unable to use global $wbdp inside a plugin
- call a string/function from database
- How to call custom function outside from the admin page?
- making php value numeric
- Strip from or something better?
- Add a select-option to the default widgets
- Defining multiple categories for showing latest posts
- the_post_thumbnail issues
- Is there a way to create a “copy post” link?
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Display additional page templates and a sidebar on plugin activation
- Dynamic Menu drops pages?
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- WordPress SQL JOIN query
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- Adding an Unlinked Space in a Custom Function
- exclude custom post type from running a function
- Taxonomy term description with style, only if the description exists?
- Exclude function from running on a certain page
- Convert all uploaded PNG files to PNG-8 format
- AJAX function not working [closed]
- Migrating site, only header shows
- Customize field names in backend profile edit page through function.php [duplicate]
- Make table disappear when fields are left blank?
- populate select options from extra mysql table data
- Menu not styling. New menus functionality giving me a headache
- Get date function not working
- Query the links Database
- Fetching review value using wpdb class
- Pagination Not Working (pages duplicating content)
- Use of antispambot with $curauth->email
- Auto create Nextgen Gallery on post creation [closed]
- Uses for function: wp_update_user
- How do I call an external php non WordPress class into functions.php?
- Insert content into head tag with function
- Function to call either single post or category
- Custom functions for string data calculations
- How are these PHP functions applied to a specific page in WordPress?
- WP insert post Redirect after function has executed
- The additional fee for the COD payment method not visible in the front-end
- Hide media for non logged in users
- Programmatically revert to backup .htaccess a possibility?
- PHP identify duplicate words in a text string against a list of words
- How to access all meta data for RSS feed?