I used
define( 'SHORTINIT', true );
$path = $_SERVER['DOCUMENT_ROOT'];
include_once $path . '/wp-load.php';
it seems to work fine.
Related Posts:
- How to return number of found rows from SELECT query
- Can i use php sql functions instead of $wpdb?
- wpdb::prepare was called incorrectly
- Custom query to get post names beginning with a digit
- How to display only first value of database column in WordPress
- Print out WordPress user ID – two sites with same code but different output
- WPDB: how to get the value of a field in a custom database table
- Can’t use get_results() in ajax query
- PHP syntax error when using wpdb update?
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- WordPress get pagination on wpdb get_results
- Ajax $wpdb not returning table data
- Converting MYSQL to WordPress $WPDB
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- Show MySQL errors that occur when I excute $wpdb->insert()
- Get stock by custom meta field on all Woocommerce variable products
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- how to delete 30 day old data using PHP [closed]
- Echo a hierarchical list of post data from custom fields
- Display fields as values in array from external SQL DB
- Can’t get wp_insert_post to work
- Trying to establish connection to External Database
- Getting id of poll from WP database
- How to insert a single row to WP database table?
- I want to select the from values from database in WordPress? [closed]
- $wpdb->update with multiple parameters gives error
- Querying wpdb using PHP
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- wp query foreach deleting record returning only first or last item
- Database query works fine outside WordPress
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Help with a $wpdb MySQL Query
- Fatal error: Call to a member function query() on a non-object
- Custom array from a query only write the last row of the query
- Querying Database with wpdb
- $wpdb returns duplicate posts
- Wpdb->insert() doesn’t insert new row after the last one
- how to get serialized post meta
- Use $wpdb or other PHP script method to find/replace in WP database
- How to get specific attribute from DB
- Basic wpdb update question
- wpdb Cannot Update column in Database
- How to use mysql LIKE with wpdb?
- PHP -> SQL Query with Summing
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- How do I prepare strings for insertions as values into a MySQL table?
- How to use AJAX in WordPress in MYSQL query?
- Change MySQL PDO connection to a WPDB connection
- WPDB – Read and write value from / to database
- $wpdb->get_results breaking page?
- How to Generate a list of Most Commented post?
- Why won’t this wpdb get_results query return results?
- WPDB secure custom form
- Undefined variable: row?
- Call to a member function get_row() on a non-object, Unable to use global $wbdp inside a plugin
- select a single val though a table in wordpress
- populate select options from extra mysql table data
- Query the links Database
- WordPress get last inserted user id
- Add posts to custom table in database instead of wp_posts
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Passing in MySQL prepare statement parameter separately throwing error
- Database SQL query error
- WordPress SQL Prepare
- MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?
- What is the correct way to search 3 custom fields only in WordPress?
- Using wpdb to connect to a different database is not working
- Looping through custom data in a custom table to display all items in a post
- Displaying SQL query result from user input via wpdb
- How do I create a WP endpoint that retrieves all custom post types that have a tag?
- 403 Forbidden WordPress Database Results
- How to grab data from input and store it into custom table in database?
- Rewrite SQL query as a prepared statement and use in foreach loop
- How to return count of items found in SQL query
- Update user_email via php – WP 4.7
- Unable to pass variable to database
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Passed variable gets undefined variable error on insert on next page
- Run insert if no entry otherwise run update with ajax
- MySQL queries in WordPress
- Order by in foreach
- At what point during a typical request does the $wpdb object become available?
- Get null from POST
- 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 display inputted data in Ajax without button or click event
- WordPress Query -> Ajax Query
- how to display tables via ajax
- Changing regular db connection to $wpdb
- Can’t send form data to wpdb when URL has query string
- $wpdb how to make a record lookup
- How to get data (not value or name) from radio options to POST to database
- Error resetting database index using ALTER TABLE in $wpdb->query
- WordPress / PHP: Check if column has value and then check if value in array
- Putting form result in my database
- SQL – How to echo out inside of where statement
- How can I update a value of a field depending on outside source?