There’s error in your query statement. Change to this
$post_id = $wpdb->get_var( "SELECT post_id FROM $customtable WHERE uniquecode="$uniquecode" AND blog_id = '$user_blog_id'" );
Related Posts:
- How to delete all records from or empty a custom database table?
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Create a table with wordpress plugin boilerplate
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- Custom select query two tables by a meta key
- $wpdb->delete not working for me
- How to fix slow comment query?
- Plugin does not create a custom table upon activation
- Proper way to trigger a MySQL query via link in a plugin
- How to create specific wordpress Table
- Best collection of code for your 'functions.php' file [closed]
- Should all plugins be encapsulated in a Class?
- Show a different number of posts per page depending on context (e.g., homepage, search, archive)
- OpenID for WordPress 3.x? [duplicate]
- Get a button for in the Editor
- Search and replace text across all posts
- Can’t pass table to $wpdb->prepare
- bulk post_content update
- Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload
- WP get_permalink Return Wrong URL
- WP Plugin for Terms of Use
- How to add product images using script?
- Automagic Link Shortening for Non-Hosted WP
- Setting up widgets in wordpress with a unique ID for the after_title argument
- MailChimp integration that allows users to select from multiple lists [closed]
- Distributing and packaging plugins
- Use plugin or custom post type for game score functionality
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- How to add rewrite rules and pagination to retrieve attachments files?
- Copyright messages for a particular set of pages
- Post query – show posts from specified day and month and whole years
- how to load the language file in plugin?
- View Private Published Page with URL Code (no login required)
- Translating long texts with html formatting
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- custom payment gateway in woocommerce failed to connect to remote api server
- Send reply with pre-prepared answers
- $wpdb->replace: WHERE?
- $wpdb->get_row returns column name instead of column value
- Anspress Customization: How to show logged in user votes on a single answer?
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- How create Group Blogs based on user created Groups
- WordPress and a secondary database?
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- Can I create a table on my DB without creating a plugin?
- Inserting custom PHP script on homepage
- Best practice for including plugin output in a template without using shortcode?
- correct validate and sql query
- a weird attribute on every html tag
- Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?
- How to change the wp_upload_dir() path in plugin
- Disable plugin only for one post
- Advanced WordPress plugin activation detection
- How to return the values from a row where a value occurs for the first time among the rows available?
- how to change wp-admin url using function file
- Calling a save function from a “submit” button
- Is there a way to easily manage Project options (custom-fields)
- Renaming Custom Taxonomy Values
- Add a “default sorting” menu to child store pages
- Plugin code will not work properly inside a class [closed]
- Custom Module, Extending WP with a Plugin?
- Rename Smart YouTube’s httpv back to http for all posts
- WordPress FLIR (Facelift Image Replacement) plugin clipping off end of text
- Some error in mysql script ? Can’t working to create table
- How to make PDF books readable on site with woo-commerce?
- WordPress search input in database, to edit information via form and update the database
- create pages automatically and dynamically in wordPress
- Post source link plugin – small modification
- Can we hide a certain user in WP?
- How Can I Increase Breadcrumb Position Count (Starting From 2)?
- How to securely controlling data without keeping it in postmeta?
- Add custom WordPress admin page with pretty url via code
- Why does plugin_url append absolute file path?
- Load my Inline js footer area
- Custom Icon assigned to menu items not working for multi-site networks
- How can I save cookies to members
- Fastest and most efficient SQL query to check if UID exists
- Overwrite user role
- Place content inside the Post Loop
- Having trouble going from Jfiddle to implementing in WordPress :(
- Custom pages with plugin
- Should I paste CDN links in a JS file or use a Bootstrap CDN plugin?
- Problem with Duplicate Meta / tag description in Webmaster Tool [duplicate]
- Write mysql credentials in plugin
- Restrict my pages from public
- Style WordPress Custom Post Type Single Page
- How to maintain WordPress permalink structure with custom content with URL parameters?
- Posts are deleted everyday at night
- Simple Data Table Update and Page Integration
- Is it safe to increase/alter the size of the wp_post.guid column from VARCHAR(255) to VARCHAR(2048)?
- WordPress Code Access to Restricted Content without Registration
- What can I do to customize a widget provided with this plugin? from where have I to start?
- $wpdb selects wrong database
- How to pre-set WordPress settings for specific posts?
- Create Custom Coupon Type
- Using ACF to allow user to add and edit multiple saved forms
- How to set an exact search box in tablepress plug-in