I guess meta_key is not a number, so you shouldn’t use %d in yous SQL query.
$wpdb->prepare( "SELECT meta_value FROM %s WHERE user_id = %d AND meta_key = %s",$userMeta,$user_id,$practiceKey ); // meta_key = %s not %d
PS. You don’t have to escape table name in this way. You can use
$wpdb->prepare( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = %s", $user_id, $practiceKey );
Related Posts:
- Creating two database tables via plugin
- insert data in database table from plugin with WP3.1
- How to count number of records found in a database table?
- DROP TABLE with uninstall hook not working
- What database state changes happen after a post is manually “updated” with no changes?
- Insert data in custom table during new post creation
- Delete tables from database when deleting plugin
- How to run Two WordPress blogs with different themes and with single database and same content
- Plugins or Tutorials for displaying data from SQL-db on WP-page? [closed]
- How do I check what plugins are enabled via the database?
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- Create custom column in post table in wordpress
- Custom database or Custom Post Types?
- Find out if request is for custom post type archive before query runs
- Get the last post ID
- Add agenda items and notifications
- Taking WordPress table prefixes into account
- Changing BIGINT to INT
- WordPress register_activation_hook table creation not working
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- How to add Edit | Delete button on rows?
- The plugin generated x characters of unexpected output, $wpdb not defined
- Advanced Custom Fields query
- clean wp_options table unused rows
- Can I run multiple queries with $wpdb->prepare?
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Get total number of comment of the posts written by an author
- How to write one comment and publish on every post using database or plugin?
- Make id column as AUTO INCREMENT on plugin activation
- WP_Query ordering numbers as letters
- Saving Custom Post types and fields to a custom table
- WooCommerce shop page orderby [closed]
- When to use action hooks and plugins
- How to create custom tables in WordPress using my own plugin?
- How do I “get the next 10 posts after post_id == x”?
- AJAX search posts and pages
- how to oauth1 Wp plug-in revoke/reset.?
- How can I perform high-level database merging for WordPress within continues delivery?
- WordPress Backend HA (Automatic failover)
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- wp_editor content in plugin options page
- Multiple instance of data in plugin custom database table on plugin activation
- WordPress plugin creating database in localhost but not on real host
- Redirect to another page using contact form 7? [closed]
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- How do i edit the plugin files in DataBase via phpMyAdmin?
- How to insert and call new data in wordpress website database through a plugin
- WPDB: Update table
- Separate database for a wordpress plugin
- How to keep variable `$post` to using in another file
- How to get a list of bundled products using wp_query in woocommerce
- WordPress Apply filter in plugin causes 500 internal error
- Meta query for comparing two dates
- Making my plugin create a page?
- Add some fileds to the wp_posts table
- Always get creating a new table with foreign key
- How to do database for download stats?
- What is the WordPress approach to custom data?
- How retreive saved data from gravity forms in my template?
- Add user meta after a user has registered and logged In [closed]
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- How to relate 3 wordpress components with each other (Create database relationships)
- How to access the WordPress DB from a plugin file
- Delete data from custom table when deleting a post
- Pagination not working
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- How to search post titles with whole words only, but not the exact word only?
- Use get_pages() before another plugin modifies it
- How to Join wp_posts & wp_postmeta table using custom query
- Bulk Edit Media Library alt, caption, image names
- Cant create table on plugin activation
- adding dynamic/multiple slug values in ‘option_none_value’
- Moving a few select DB tables to a new WP instance
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Only return taxonomies that are linked to a category & product
- How to add specific posts to specific pages in WordPress?
- How to use information from the database in the front-end?
- Enable plugins that are “not supported”
- User Following System
- ACF Query result in a new td (echo)
- Multiple Meta key in search
- My plugin can’t see my files
- History of page, interval of years
- Show a table from data submitted by a form from a user
- How to save information related to post in database?
- RSS Feed has no Items (Possible Plugins Conflict)
- A plugin is giving me “You do not have sufficient permissions to access this page.” error
- Second foreach loop breaking (Posts2Posts)
- Ger posts from similar tags and categories
- Making a Custom Post Type Publish Loop
- Include subtitle display to slideshow
- Creating fields in the database
- Allow users to enter and edit data in one-to-many configuration
- Updating WordPress [closed]
- I want to display data last 7 days with date wise in chartjs?
- Does anyone recognize these table names?
- Edit a page/post DB data?
- plugin doesn’t retrieve data from database