The wpdb class, accessed via the $wpdb global variable, is used to interact with the WordPress database
0
votes
1answer
17 views
how does offset works on Pagination? (get_results)
I followed this link and created my own custom query with pagination.. but I don't really understand how the offset works,
Pagination with custom SQL query
the pagination does not work well. and I'm ...
0
votes
0answers
36 views
Retrieve post data via WPDB class
I'm trying to figure out doing a custom query using the $wpdb Object.
I have custom type posts, event_posts, that have meta data, images, as well as event dates which are input in the post with the ...
0
votes
2answers
76 views
$wpdb returns no results with SELECT query on custom post type, works on default post type
EDIT: Adding more background info.
I've coded a plugin that adds a meta box to the post page. When the post is published, the plugin will generate a random ID for the post, and insert the random ID ...
0
votes
0answers
41 views
Script timeout when importing/inserting > 45-50 posts from an external table
Wondering if anyone can spot the obvious mistake or give me some guidance on where I'm going wrong.
I should also state this is my first plugin with Wordpress, so I'm sure I have overlooked ...
0
votes
0answers
41 views
get_query_var('paged') giving same result
I have a custom page, in that page i am using a custom select query for my search functionality.
The problem is pagination not working. I used $on_page= get_query_var('paged'); for pagination. When ...
0
votes
1answer
34 views
How-To: wpdb Insert Record With Date
I am writing a plugin where I need to pre-load some data in the custom tables that I create upon Activation. My inserts have run fine thus far until I attempt to insert a record with a DATE datatype. ...
0
votes
1answer
18 views
How do I query for posts by custom meta and those that have been stickied?
I realize how clumsy and inefficient this query is but SQL is not my strong point. I use the following query to pull the latest 8 events from a custom post type called Event Posts. However, I also ...
2
votes
1answer
54 views
How to order by blog ID in this multisite 'List Blogs' custom function
I found this really cool function to list all the blogs on a multisite network install.
Because the original multisite list blogs function was depreciated :/
So I am using this function below ...
0
votes
0answers
46 views
Custom query on Wordpress custom table
I am working with a custom table where some values will be inserted or updated if they already exists, I have checked and rechecked the syntax and it seems to be working fine, if I run the same query ...
1
vote
1answer
18 views
wpdb query problem to access previous 3 days posts
I am trying to get all published posts titles by author id 2 most recent by post date for the last days. Here is my query:
"SELECT post_title FROM $wpdb->posts WHERE post_status = 'publish' AND ...
0
votes
1answer
43 views
$wpdb->insert Database Error Duplicate Entry Error Logging
Is there an equivalent to INSERT IGNORE in the wpdb class? As I'm fetching and inserting a twitter feed and the field in which I store the tweet ID is keyed UNIQUE, I am aware that duplicates are ...
-6
votes
0answers
29 views
I found your post below and it worked great but [closed]
I was wondering how to add a custom field filter so in the code below how could I also filter to get only posts starting with letter X AND have custom field X.
get_results(
...
0
votes
1answer
12 views
Create Table Failed Column Date DateType
I have a plugin that creates tables and one of them is failing and I feel like it's due to either my syntax or the fact that I'm trying to create a column with datatype DATE and not TIMESTAMP (only ...
0
votes
0answers
28 views
Adding New attribute in wordpress
I'm using Wordpress to implement the website:
The pages in my templates should be sliding vertically, so there is a 'Next' button in the end of each page. Now my problem is in the admin section ...
0
votes
1answer
46 views
Custom SQL query ORDER BY term_order
I have custom taxonomy that list terms under "series" that contain posts that are also present in terms under "media_type" and where media_type is term_id 16.
I want to order the list by the ...