I think you will need to include some type of WP core file into the save.php
file (I could be wrong). Since this file isn’t being called specifically by your plugin (or WP for that matter), it won’t have all of the variables that WP has to offer.
Try adding this to the top of your save.php
file:
require_once '../../../../wp-load.php';
There may be better ways to get the URL, and even maybe a better file to use than wp-load.php
, but at least to verify it works that way will probably relieve some stress.
You may also want to use global $wpdb;
in save.php
after wp-load.php
is included.
Related Posts:
- wpdb->insert: do I need to prepare against SQL injection?
- How do I check for a duplicate record before inserting using wpdb
- WPDB prepare – like % – placeholders?
- $wpdb->update multiple rows, like IN in normal SQL
- Avoiding “Usage of a direct database call is discouraged”
- dbDelta does not create Table, but returns success
- passing variables as parameters to stored procedures via wpdb from php-script
- Quotes in table name
- $wpdb->get_results() returns good result only in first foreach iteration
- $wpdb->insert – inserting multiple rows
- How Can I Use $wpdb in PayPal IPN file?
- $wpdb->query() multiple query support
- Set media metadata (i.e. “dimensions” field) on SVG file after extracting it with a filter
- $wpdb->prepare not working with update table prefix
- How to use prepare to query with variables
- how to execute different sql query in non-sanitized $wpdb->get_results function
- $wpdb not returning data
- $wpdb Query Result not coming but in phpmyadmin it works [closed]
- WPDB update row with != in where clause
- wpdb->get_row() / get_results – is it possible to return an object instances of my own class?
- Problem in creating table through plugin code
- How to email user after inserting the username in database in WordPress
- Join inside a wpdb query.. confused!
- How to fetch an array in $wpdb?
- Why doesn’t my insert query work?
- How to prevent $wpdb->prepare stripping a leading zero in variable value?
- Generate a unique hash/number for tracking on $wpdb insert
- wpdb->insert and stripslashes against sql injection
- Rolling Back from current WordPress version to previous one
- $wpdb select query by month, post type, and taxonomy term
- WPDB – How to search a column in a table
- What is wrong with this wpdb update?
- using $wpdb to insert a form into a post
- wp_create_user not properly entering password
- How to display user_nicename and usermeta values by custom query in WordPress?
- Foreach loop not working as expected – custom tables and references while submitting a form
- Query insert query executing multiple times
- Undefined offset: 0
- Connect to separate database using $wpdb and authenticate user
- How to access PostgreSQL using WPDB?
- How can I combine one field using wpdb and group by?
- how to use $wpdb->prepare to update a custom table
- $wpdb not being defined in function: Fatal error: Call to a member function query() on a non-object
- Counting posts with argument without retrieving the posts
- How to obtain a reference to $table_prefix in $wpdb object
- Trying to Connect to different database
- how to assign content to a different author while loading content
- Why does this WPDB code throw an empty WPDB error? [closed]
- wordpress $wpdb works only once
- get_results not returning anything
- WordPress core code contains things marked as deprecated by… WordPress?
- $wpdb – joining shows no result
- Compare transient data with a meta box value
- Register custom table for WP to use in a plugin
- wpdb->get_row is selecting the variable as a column name
- CREATE TABLE with dbDelta does not create table
- Display category names on edit user profile using $wpdb
- Get unique results from this function
- wpdb and acf via wp rest api
- WPDB SQL Ignore `post_status` Parameter
- WPDB Table Does Not Exist
- Inserting a MySQL record into a table with an array of field names and an array of values
- Incorrect Use of wpdb::prepare()
- wpquery properties last_query and last_result : should these be public or private?
- Ascending order of yearly archives [closed]
- Query and get meta as object(stdClass) on wp postmeta table?
- How do I query a table?
- $wpdb->get_results(…) with $wpdb->prepare(…) returns empty array despite correct query
- wpdb insert formatting for date in array
- wpdb->insert with special chars failing with collation utf8mb4_unicode_520_ci
- SQL queries to another wordpress site
- Access to numerically indexed array in wpdb Class and undefined offset
- og:image functions.php
- $wpbd->insert() does not insert user data
- Why $wpdb->insert and $wpdb->update not working server but it is working in localhost?
- wpdb prepare placeholders for MySQL keywords
- Sql query triggered twice
- Show error messages to a user when database insert fails
- Unable to insert data into using custom plugin
- Debugging db calls: $wpdb->insert works on test site, not on identical production site
- Combine posts and postmeta
- Creating an Angular factory from custom database table
- wpdb get_row database query inquiry
- Depreciated Call -> Function wpdb::escape()
- How do I update post based on meta_key in another table?
- Object Cache – Avoid db queries totally
- Inserting and updating rows with wpdb indreases integer fields by 1 point sometimes
- Creates only one table and not the other
- Retrieve a list of users based on some conditions
- adding a log row log table, when the draft post publish
- Echo only gives me the first part of string
- looking for a way to allow users to backup the plugin db data(save as)
- wp-postratings: list current user’s unrated posts
- Error inserting row into table
- How to update user profile or inputing any data to the wp db from external site?
- get only 1 wpdb and get taxonomy, post to next page [closed]
- $wpdb The query does not contain the correct number of placeholders
- Get count of rows based if column exists in two different tables
- Table wont load into WPDB
- WPDB prepare – like % – placeholders?