The sql tag has no wiki summary.
2
votes
2answers
128 views
What is an efficient way to query based on post_meta?
The problem I am having is when I allow users to filter posts it overpowers the database and things run extremely slow. I am unsure what the best way to query posts using meta values is. My site has a ...
0
votes
2answers
30 views
Create a new page for each form selection
I have a got custom page template which displays a drop down box that has list of countries.A user selects the box and clicks sumbit.Page then then displays the relevant details for that country .IT ...
2
votes
1answer
164 views
Bulk add tag (or any sort of label) to posts who have custom excerpt
The situation is the following:
The blog as of now has 2200+ posts. In the beginning (2007/2008) I was using manual excerpts where I would put an image and a little bit of text. The manual excerpt ...
0
votes
1answer
21 views
SQL Bulk Move old posts by one author to another category
I'm looking to move a number of old posts by one author from one category to another category and was hoping someone could help me do this?
I figure the easiest way would be through an SQL command?
...
0
votes
1answer
41 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
83 views
Export / import Wordpress database
Is there a proper way of exporting and importing a big WordPress MySQL database to a new database?
When I tried to do that in the standard way I run into 2 issues:
All widgets disappeared and I had ...
0
votes
1answer
73 views
Bulk move (or copy) from a custom field to the post content?
I need to move (or copy) the contents of a custom field into the main post body, replacing any existing content.
I need to do this for a few hundred posts...Is there a quick way of doing this?
I can ...
0
votes
1answer
759 views
using AJAX to run sql statement and populate dropdown
I am trying to create a search where the user select two different bit of data from databases and it them prints some results that meet requirements. I know I need to use ajax or something similar but ...
-1
votes
1answer
125 views
SQL query to return categories and category parents
I have some categories which are not correctly defined.
I.e. their parents are messed up.
How can I select with SQL all categories and their parents?
-1
votes
1answer
61 views
Adding profile data to database
I added a custom field to my wordpress user profile page that asks a user what their favorite browser is. I have the field on the profile.php page, but how can I get this field into my sql database?
...
1
vote
0answers
26 views
Meta Query And/Or
My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto.
With the exception that my logic is different.
I want to query, for example, posts with ...
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 ...
0
votes
0answers
27 views
Get posts under a category with SQL
How can I retrieve posts under a category with plain SQL with out using WordPress native api's like get_pages?
My Wordpress table wp_terms contains a term named Restaurants.
I want to list the post ...
0
votes
0answers
8 views
Advice or Best Practice on setting attributes and properties for user on login
I’m working on a web application service which is going to use a lot of the built-in Wordpress functionalities but also relies heavily on some customized code and tables to create - among others - ...
0
votes
0answers
40 views
Heavy SQL queries
I have got rid of one of SQL problems but the story isn't over. Now hoster has detected another problematic SQL query and again threatens to disable the account. Can anyone advise on what's going on ...
0
votes
0answers
44 views
Install WordPress with SQL database
I am very new to WordPress. I didn't even know it existed until I had to do it for my work. So I started in with a WAMP server with WordPress. That worked fine until we needed multiple sites with ...
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
16 views
Advanced search: roles and multiple taxonomies
I have a site with custom roles, and custom taxonomies. I'm making the advanced search, where custom posts can be filtered by roles and taxonomies.
To accomplish this, I'm using my own custom SQL ...
0
votes
0answers
47 views
Special Query: Title, Terms, Content - %LIKE%
I'm working on a them theme that is search-heavy, and my users are putting huge priority on an improved search function.
I think I will have to use a special direct query to search these things:
...
0
votes
0answers
35 views
Convert date format in meta
I have been storing date format in meta key/value. I have been storing in this format (mm/dd/YYYY) now I need to convert that into (YYYYMMDD) SO I can run a date match in query.
Please advice how can ...
0
votes
0answers
43 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 ...
0
votes
0answers
36 views
posts_per_page is set to 1, returns 50 posts
I'm trying to get the latest post in a custom post type:
$query = new WP_Query(array(
'post_type' => 'some_custom_post_type',
'posts_per_page' => 1,
'orderby' ...