MySQL is an open-source, relational database management system.

learn more… | top users | synonyms

2
votes
0answers
252 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 ...
1
vote
0answers
94 views

Slow wp-admin due to “SELECT DISTINCT post_mime_type FROM wp_posts WHERE post_type = 'attachment'”

The media library on a large site is slow in wp-admin. I did some research by looking into slow queries in the sql and found that this query is causing the slow response: SELECT DISTINCT ...
1
vote
0answers
22 views

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog. So I need your help to find the smartest solution to do it, ...
1
vote
0answers
169 views

Slow meta_query with about 4 milion record on wp_postmeta

Although optimized wordpress all the way but still very slow as follows : I have converted from LONGTEXT meta_value field to TEXT Then create INDEX for this field ALTER TABLE wp_postmeta ADD INDEX ...
1
vote
0answers
84 views

Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin

I have a wordpress table like so (phpmyadmin and MySQL) | id | meta_key | meta_value | +----+-----------+------------+ | 1 | import_id | abc | | 2 | import_id | abc | | 3 | ...
1
vote
0answers
184 views

MySql Query very slow

I have a problem with a query on my website. When I load the page it is incredibly slow and only after over 12 seconds the content starts showing. I have installed a debug plugin and found the query ...
1
vote
0answers
64 views

Calculate average crossing post categories

In my WP database I have some posts i the category hotels and some other posts in the category visits. In the posts (placed in the category visits) there is two meta_fields ( rating and placeid ) ...
1
vote
0answers
162 views

Renaming admin user on multisite install by MySQL

As part of a general tightening of security, I want to change the name of the admin user on my multisite install to something less commonly used. This user is admin on all five sites in the network ...
1
vote
0answers
209 views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
1
vote
0answers
496 views

$wpdb->insert() does not Insert record in a table

I'm trying to understand and get hold of the $wpdb global object but can't seem to make it work. Basically, I'm trying to insert a single record into a custom table in wordpress DB. Instead of ...
1
vote
0answers
246 views

Wordpress running SQL query to update database from form

Basically I want to take information in from a form and use a separate php page to update the database. so here is the original wordpress php page (add_person.php): <?php /* Template Name: ...
1
vote
0answers
348 views

Cleaning up bloated wp_postmeta table by removing multiple _thumbnail_id's?

On a very old site (7 yrs) with a lot of posts (30k) I've been trying to whittle down the database tables. The postmeta table is 1.5m rows, 750k of those rows are for a meta_key named ...
1
vote
0answers
1k views

How to fix database error duplicate entry

At first I thought this was just a damaged table, so I tried repairing via MySQL, but it appears there's more fundamental issues. Which of the duplicates should I remove, and any further advice in ...
1
vote
0answers
119 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
312 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
80 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
203 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
253 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
56 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
16 views

Can connect to db normally but I can't select, Access Denied

I have a problem that happened in my website and I don't know how to fix it some data are disappeared and when I debug I find this error WordPress database error: [Access denied for user ...
0
votes
0answers
13 views

WordPress Query Count

So I've used get_num_queries() and the "debug bar" plugin for a while to monitor the number of queries running against the database. Earlier today I turned on the MySQL query log for an unrelated ...
0
votes
0answers
30 views

Dynamic data from external database - display in several WP sites

I have looked at similar questions, they don't seem to answer my specific question. I have an external database (not using tables in the WP database). I have several sites that need to pull dynamic ...
0
votes
0answers
15 views

How do I transfer an existing website running on Joomla to Wordpress?

I am currently the Admin of a site that is running on Joomla 2.5 and I am looking to migrate existing content to wordpress. Please help.
0
votes
0answers
12 views

Querying sanatized data with meta_query in Wordpress

I asked this question over at SO yesterday, but I see now that this is the right place for it to live. After Googeling this for a while, I've found that this should work cite, but I don't seem to get ...
0
votes
0answers
18 views

Alter wp_post table vs. post_meta performance/speed

I'm searching for the most efficient way to link a post to multiple users. By default each post in wp_post has a post_author column, which is linked to the corresponding user ID in wp_users. Assume ...
0
votes
0answers
11 views

dbDelta not creating tables with composite keys

I've been trying to figure this one out for 3 days now, reading every reference on dbDelta I can find. My ultimate goal is to create a table of unique ad_id, ad_trigger pairs. This does not create a ...
0
votes
0answers
18 views

Pages edit as posts

I'm currently dealing with the fallout of the following question (How to change post to page). I got all my pages back though all the pages' URLs were changed so there is no hierarchy and when I try ...
0
votes
0answers
18 views

Set Display Name to first and last name (phpmyadmin SQL Query)

I'm trying to change all the users Display Names to be their first and last name. I have looked into a number of plugins and wrote my own PHP to try and accomplish this however the site has over ...
0
votes
0answers
66 views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', ...
0
votes
0answers
40 views

Sanitize a working query string by using $wpdb->prepare() fails with MySQL DB error “right syntax to use near '3' at line 1”

I was using the following properly working query so far: $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta1, $wpdb->postmeta wpostmeta2 WHERE wposts.ID ...
0
votes
0answers
31 views

Using $wpdb (WPDB class) 'replace' with multiple WHERE criteria problem

I have two fields that are used to identify a particular row (acting as a composite key). If it does not exist, I wish to insert a new row. The REPLACE function ...
0
votes
0answers
26 views

using a function in functions.php to process a form generated in functions.php

so i have a site where users can rate items, it saves their ratings to a mysql db and also tallies the average for the item, saving that as well. as it is a generic function and there are hundred of ...
0
votes
0answers
44 views

is_user_logged_in() not working after domain change

I am relatively new to Wordpress and I recently moved a WordPress website from one domain to another. I went through and fixed all the links and references that I could find. Now my website has all of ...
0
votes
0answers
50 views

Update table only if checkbox is clicked

I'm building a little home security project where it should be able to turn the system on/off from a website and by a password on the device. My problem seems to occur with the code from my website. ...
0
votes
0answers
18 views

WP Query with multiple posts and meta queries

I have three custom post types: Stories, Venues and Cities. With Advanced Custom Fields I have added a related custom field to each post type. Each Story has a Venue ID and each Venue has a City ID. ...
0
votes
0answers
54 views

MYSQL sleep process for 20 seconds while site is “waiting for…”

I'm running WP 4.0.1 on an Ubuntu VM server. The server has no outside internet connection, so I have enabled define('WP_HTTP_BLOCK_EXTERNAL', true); in wp-config.php. When I click a link on the ...
0
votes
0answers
15 views

How to make list of checkboxes based of number of distincs value of some custom field?

I need to make list of checkboxes based of number of distincs value of some custom field (Country) for visitors able to choose only post where this field Country the same as they are interested one. ...
0
votes
0answers
73 views

MySQL 1005 ErrNo 1 - “can't create table” when importing DB backup into phpmyadmin?

I have been developing a WordPress site locally using the following mysql version: LOCAL DATABASE SERVER: Server: Localhost via UNIX socket Server type: MySQL Server version: 5.5.40-0ubuntu0.14.04.1 ...
0
votes
0answers
31 views

Translate SQL query to wp_database with JOINS into wp_query

StackExchange members! It's so happened that I'm using straight SQL queries in my application. I'd like to rewrite it and use WP_Query, but, unfortunately, I have no idea how to translate, let's say, ...
0
votes
0answers
175 views

two wordpress sites, two themes, one database, same content

I am doing research about wordpress and there are many interesting stuff to learn, i browse the wordpress forum and i found a post about duplicating site.. or multisite.. I am not sure exactly how it ...
0
votes
0answers
40 views

MySQL query to mass change role of users

I'm looking for a MySQL query to achieve this purpose: Change the role of users that never posted and have registered before at least 60 days. The role to be changed to is a new role to be created ...
0
votes
0answers
63 views

Creating a custom Search Form that links to a custom database?

I'm kinda new in Wordpress and I'm still learning as I go along. Currently, I'm trying to create something like this I have a custom set of database in the server in mysql with a table. The ...
0
votes
0answers
86 views

Can one effectively use non-ClearDB databases on Windows Azure?

Has anyone tried and effectively used a database provider other than ClearDB with WordPress on Windows Azure? I like their service but they are a bit pricey. Since they are the only listed provider ...
0
votes
0answers
41 views

MySQL errors after a Wordpress clone

I've just cloned one of my wordpress installs on to a different domain, but each time I try to go in to certain setting screens through the dashboard, I get the following messages at the top of the ...
0
votes
0answers
91 views

Meta query with regular expression

I am using regular expression to refine the post it works fine but i want change it such that it can work with meta query instead of post title here is my code function wpse18704_posts_group( $where, ...
0
votes
0answers
19 views

filter wptexturize doesn't work on old posts titles

I have an add_filter('the_content', 'wpt_content');. My function wpt_content does a wptexturize($text). But It's work only on save post, so my old post has bad 'and my new post ’. I don't ...
0
votes
0answers
62 views

Adding a Custom Taxonomy Term to sql union query

There is a beautiful solution to getting the next 3 posts before and after the currently viewed post solved here. However, I would like to narrow the query to just a specific taxonomy term in a custom ...
0
votes
0answers
27 views

Shop coding dynamic permalinks & titles

I have built a shop application using php and mysql and wasn't sure how to add it to wordpress but I had a stab at it anyway, I managed to get it to function fine but because the pages are dynamically ...
0
votes
0answers
46 views

Install will not load: PHP does not have MYSQL installed

I'm having trouble installing Wordpress on my Windows 2008 R2 server. I'm getting the message: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. To ...
0
votes
0answers
228 views

`#1215 - Cannot add foreign key constraint

create table wp_pageviews ( ID BIGINT(20), count integer, primary key(ID), FOREIGN KEY (ID) REFERENCES wp_posts(ID) ) Error : #1215 - Cannot add foreign key constraint ...