MySQL is an open-source, relational database management system.
2
votes
2answers
312 views
mysql custom wp query
this code is designed to select posts with selected meta value in wordpress query
<?php $values = $wpdb->get_results("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ...
1
vote
2answers
50 views
wp_insert_post sometimes fails after API call
I have built a plugin that fires an Ajax call to connect to a third-party API. That API returns some Json, which I then save as a custom post with wp_insert_post.
Now, usually, this works. But, now ...
1
vote
2answers
744 views
Help with MySQL to $WPDB query
Here's my issue. I have three tables I'd like to query - states, points, and state_points.
States contains stateid, and name. Points: pointid, pointlat, pointlng. State_points: Stateid, Pointid.
...
0
votes
2answers
65 views
MySQL Syntax Error upon restoring database from backup
Performed a bad import to my Wordpress install and decided to restore from the mqSQL backup (full export) I had made minutes earlier.
Dropped all tables in the database and then did an import from my ...
2
votes
1answer
151 views
Grouping related postmeta data via SQL query
I am using someone else's WP plugin which stores lots of related data in wp_postmeta using an "artificial key". So effectively we hijack wp_postmeta to create a nested relational database. So one row ...
1
vote
1answer
797 views
How to get a Google maps SQL->XML->map marker tutorial to work in WordPress
I have been trying to figure out what is wrong with my code for a couple days now, and I cant seem to crack it. I am trying to follow this tutorial: ...
1
vote
1answer
82 views
Custom order for Mysql array
I have a Page of Posts, each post has a Custom Field "expired" which contains a date in the format YYYY-MM-DD which is used to order the posts. This date is used for a script that tells the visitor if ...
1
vote
1answer
190 views
How to let a user choose an authors and save it to the database?
I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user ...
0
votes
1answer
32 views
Print output of Table Creation
I am creating a few tables and I getting the following message:
The plugin generated 440 characters of unexpected output during
activation. If you notice “headers already sent” messages, ...
0
votes
1answer
17 views
Convert many posts from having a specific meta_key to use a post_format
I have 350 posts that were using a plugin-provided option stored in a meta_key ("custom_post_template", to be precise).
I want to convert these posts to assign them a specific post_format ...
0
votes
1answer
42 views
How do I Split one Table into to lists for two seperate drop down boxes
I am driving myself crazy trying to find an answer, although I know it would most likely be something simple.\
I have a mysql table with the following columns:
id
first_name
family_name
...
0
votes
1answer
25 views
Problem with a query in custom posts
I'm making a search form to select available rooms.
I have a custom post for the rooms called "Products" and a post meta value called "availability" (format: Y-m-d).
And I want to find all rooms ...
0
votes
1answer
26 views
Filtering problem
I got the custom_post_type_data in which I store some variables when I make a new post. Variables likes Author, Price etc.
I implemented a filtering by author, so when you click on James (for ...
0
votes
1answer
89 views
Contact form with database integration issue
This is more a question about the idea I am going to share and ask for advice for.
I would like to have a contact form on my site, where people complete their data and it gets stored inside a ...
0
votes
1answer
40 views
finding out the top 5 source ( source is a custom taxonomy ), in a given category
The client I'm working with have thousands of articles and media ( audio/video ) files.
To WordPress, all are posted by Author ID 1, which we named as STAFF.
All the content though in reality has ...
0
votes
1answer
60 views
How to check for empty and not a failure
I'm querying the postmeta table to see if a url has already been entered, using this statement (where $thisLink is the url I'm checking)
$mypostids = $wpdb->get_results("select * from ...
0
votes
1answer
84 views
Using custom tables for old posts
I have a site with about 24,000 posts and 200 posts daily and the database will get huge soon. So I plan to transfer the old posts to custom tables to reduce the database load. There's no need to show ...
0
votes
1answer
104 views
Efficiently loop over huge number of posts
I want to loop all posts to do some processing, but one of my concern is there are many posts and it might used up my memory, so I want to loop posts with offset, something like paging.
e.g.
$posts ...
0
votes
1answer
22 views
Assign a tag to custom post type using a query
I have a custom post type courses with a custom field level. I want to run a query (mysql or WP query) that runs through every course (post) and if the level is greater than 3, append a tag called ...
0
votes
1answer
55 views
sql for querying post and their category
I'm trying to query the wordpress database for the post and what category they belong in. Is there a sql query that I can use for this?
Thanks,
0
votes
1answer
79 views
Drop posts from categories in MySql
Is there a way to remove all posts from all categories?
I found plugin for this, but it's very slow. What I need is MySql query that will help me remove all posts from all categories.
If you know how ...
0
votes
1answer
25 views
Multiple Wordpress Pages
Not sure how to approach this one.
I have a wordpress page that uses a mysql query to grab info from a database based on the page title.
I basically want to replicate that page to 50 or so ...
0
votes
1answer
303 views
Advanced Custom Fields Array Population
I'm trying to populate a ACF select field with an array from a custom $wpdb->get_results call, which is essentially a list of categories from my db.
I have the following:
global $wpdb;
...
0
votes
1answer
41 views
If the only thing I use MySQL for is Wordpress, do I need MySQL's timezone tables?
The only thing I have MySQL around for is Wordpress. Some MySQL features, I gather, require you to import the system timezone database into special tables in the mysql database. (Which seems like a ...
0
votes
1answer
131 views
Pull post name from value of a specific meta key
I am looking for help on how to pull post name from custom field value
for example
in wp_posts post id = 200, and there are corresponding meta key and values with post_id= 200 in wp_postmeta
I want ...
-1
votes
1answer
71 views
How can I debug my database connection for unit testing?
I've set up a wordpress environment on my Mac with MAMP and I'm running 3.5.1 locally (i.e. http://localhost:8888/blog works). I'm trying to run the unit test suit from wordpress.org and having ...
-1
votes
1answer
80 views
Custom wordpress SQL statement for a website
I'm trying to link specific columns from a few standard tables in a wordpress database. I specifically want to see a view/table that includes:
post title
post content
guid
meta value = image url
...
-2
votes
1answer
79 views
Woocommerce - Bulk Edit Stock Level
I have 30k products in my Woocommerce store. And I would like to mass edit all products to become "out of stock" before I add new batches of products.
Can anyone please let me know how to do it in ...
2
votes
0answers
39 views
Query meta field using between
I'm trying to Query some lattitude and logitude and then I get some long numbers and apperently the Query dont like that.
Let says I have these in the database
Meta-key: lat
Meta-value: 54.3415000
...
1
vote
0answers
74 views
WordPress plugin overloading with tmp tables
I have asked at the plugin's (WordPress Popular Posts) support a few days ago, since no response hope to get some insight or help here. Thanks.
Hesitant to tweak settings like max_heap_table_size ...
1
vote
0answers
142 views
How to optimize 'select found_rows()' query? Several 'high load average' alerts daily
I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies ...
1
vote
0answers
124 views
wp_admin edit.php slow with lots of queries
I have about 4,000 posts. Currently when I click on All Posts (edit.php) it's taking about 10 seconds to load and I'm showing approximately 1000 queries!
Most of them look like...
SELECT t.*, tt.* ...
1
vote
0answers
167 views
WordPress Query wp-terms SLOW
I've got a very large database in WordPress with lots of products in WooCommerce along with quite a bit of taxonomies. When querying the products on the front end it takes 1 minute or more.
Here is ...
1
vote
0answers
51 views
Regex to turn embedded images in to attachments
I've got a blog that has all images embedded in each post rather than a thumbnail linking to an attachment page which is what I'd like.
I understand from this question that no plugin (like Regenerate ...
1
vote
0answers
132 views
Retrieve/get current image from Nextgen gallery db
I thought that I can do it using the database where the idea was to get the image from the ngg_gallery_pictures table, where the browser URL is equal to URL of the image in the table.
Then I will get ...
1
vote
0answers
106 views
Query most popular terms by taxonomy over 2 week period
I have written SQL for a query that pulls the most used taxonomy terms for selected taxonomies that are published, do not have a parent post are not in a comma separated list over the past two weeks ...
1
vote
0answers
116 views
List authors with the last post title and order by last post date
I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them.
// Selects from tables wp_users and wp_posts, selecting published ...
1
vote
0answers
39 views
How can I make wordpress suppress mysql errors?
Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb?
From what I've read setting WP_DEBUG ...
0
votes
0answers
30 views
Using HyperDB to connect to a MS SQL database
I have successfully split my WordPress database into two MySQL databases (using hyperDB). And it works well. Now I want to dive into the unknown and have one database use MYSQL and the other MS ...
0
votes
0answers
28 views
Wordpress post saves until Apostrophe (’) is used
I've installed wordpress onto a fresh VPS with nginx + php-fpm, the installation works fine apart from whenever I post something with a ’ the post ends there.
It's looks to be some sort of escape ...
0
votes
0answers
59 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 ...
0
votes
0answers
25 views
Automatically create a user with author rights from outside of Wp-admin
Need to create a user on the fly based on the following steps...
User clicks a link in an email with a unique url such as
1234.domain.com/?auth=42344245534534535
when the user clicks through to ...
0
votes
0answers
31 views
Wordpress and BigDump
I am having a bit of a nightmare situation. I was given a testarea on a subdirectory of a friend's client server as a temporary favor in order to test my wordpress site. The path is as follows:
...
0
votes
0answers
12 views
instantwp how to shutdown mysql for testing?
I am using instantwp for a standalone project and i need to try out the follow scenario/problem:
"instantwp seems to be running but WP can't established a database connection"
This happened to me by ...
0
votes
0answers
31 views
query optimization and benchmarking question to fetch term_taxonomy_id for the provided `name` of term
I have been writing a some plugin for which I need to fetch the term_taxonomy_id from the term_taxonomy table of WordPress for the provided term name.
Though I tried to benchmark them but in best and ...
0
votes
0answers
23 views
Dissapered all posts by 2013 year
Dissaperd all posts posted in 2013. There are no posts, images and tags for this year. I've checked it in the phpMyAdmin and find them. But they don't shows in administrtor panel. Any idea? Thanks!
0
votes
0answers
48 views
Use $_GET with permalinks on page
I'm currently trying to use a $_GET to populate a MySQL query with in a URL on another page within a Wordpress site.
URL sample:
<a href="http://site.com/file.php?alabama">Alabama</a>
...
0
votes
0answers
37 views
Do someone know how to fetch post images sizes via MYSQL Query?
i am developing a web-services using PHP with adodb classes. what i trying to do is that i need the image sizes of the post i.e(thumbnail, medium, large) size. I am able to fetch the post original ...
0
votes
0answers
51 views
using wordpress page templates programmatically
hello I am having a dilemma with a wordpress plugin, its more logic than a code problem so I hope you guys can still help me. over all here is the function of the plugin, again all code works fine ...
0
votes
0answers
42 views
Custom Wordpress Meta Query
I have a post type (course) that has some meta data associated with it, namely the following two:
City and State
The two pieces of data above are stored in the postmeta table, with meta_keys ...

