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

learn more… | top users | synonyms

1
vote
0answers
9 views

Slow SQL_CALC_FOUND_ROWS Query

We are experiencing very slow performance with queries that use SQL_CALC_FOUND_ROWS within the admin section of WordPress. We currently have about 125,000 posts on our site and use Varnish to cache ...
0
votes
1answer
57 views

What might be the reason of Couldn't fetch mysqli_result on another domain?

I'm developing a plugin and it works fine on my Wordpress website, but I've tested it on other domains with different Wordpress instances. When trying to activate the plugin on some other sites and ...
0
votes
1answer
29 views

Wordpress doesn't display accents after migration

I know this is a common question, but I've searched a lot and only experience this since a few months, without knowing what's causing this issue of course, maybe since a Wordpress update. This is now ...
2
votes
1answer
27 views

What are conventions about the schema of the $table_prefix

I wonder if there are any conventions or best practices about the table prefix of any WordPress set up. The official documentation on wordpress.org does not make any statements to that topic. ...
0
votes
1answer
32 views

Changing order of db results when encoding to JSON

There is probably a very simple solution to this but I just can't work it out. I am getting some info from the wp database, bypassing WP's built in classes, then echoing the results as encoded JSON ...
0
votes
2answers
689 views

Custom MySQL Query for Post and Post Meta

I have a custom table called "tags" that contains a charity_id that is a reference to a post ID ... I need to query the "tags" table to grab this charity_id and then pull in the post title and a few ...
0
votes
1answer
18 views

WP_Query always returning the last custom post

I have code that works fine on our live system, and I'm porting it to a new theme. In the new theme, the WP_Query always seems to return the last custom post. My function is: function ...
0
votes
0answers
6 views

Same option_id for 2 options in wp_options?

What does it mean when (according to mySQL Workbench) 2 options have option_id = 0? Just noticed this for unrelated plugin and theme holding very different options.
0
votes
1answer
34 views

Inner join overrides Advanced Custom Fields plugin's get_field [closed]

I have this search that I made with inner join and where clause. I no longer get get_field() values, they all return false. How can I get ACF to work again? It must be something silly that I don't ...
0
votes
1answer
31 views

Wordpress mysql table double prefixes

Currently working on updating a wordpress website for a client of mine. The wordpress mysql database has double prefixes in it though. The standard wp_ prefix and her own custom prefix for the ...
0
votes
1answer
7 views

WP Database generate content for post_name column

I ran a query that deleted all content in post_name (used for SEO-friendly URLs) column. UPDATE wp_posts SET post_name = '' I thought that WordPress would automatically populate new ones if I ...
0
votes
1answer
540 views

Group posts by meta_key

I have a Problem with grouping meta_values. The Query looks for posts with the meta key "company". I want a unique listing of the colors like: blue red yellow array_unique was not successful and also ...
0
votes
0answers
22 views

Setting up automated post status change / delete system

Haha, first of all, I've been asking all my WP questions in stackoverflow and then wondered why everybody said they don't know nothing about WP. My question is simple: What's the best way in your ...
0
votes
3answers
428 views

Fetch a single row from a custom table for to a given ID

When I want to get a single row from a custom table of my WordPress database by providing a username through function call, it does not work. When I mention the username in where clause of the query, ...
0
votes
2answers
511 views

Reset/Reorder posts ID in the MySQL wp_posts table

I have a Wordpress site that is considerably popular. I am in the process of optimizing the site before adding other plugins such as the WPML plugin which I suspect will be using custom post types. ...
0
votes
1answer
571 views

How do I properly update the Wordpress database password?

A site that I manage was recently compromised and I am going through the steps to harden and re-secure the site. I would like to change the MySql database password and want to make sure I do not take ...
0
votes
1answer
537 views

Unique Post Meta Values

I want to use Unique IDs like YouTube video IDs and WordPress post IDs in a custom field 'youtube_id'. I just created a front-end add post page and want to check if 'youtube_id' used or not used in a ...
0
votes
1answer
28 views

Conditional statement within WP SQL query

I have a form on a Wordpress page posting data to a table called 'members'. I have a second page displaying this data in a table. All is working well. The data is being displayed using: $myrows = ...
0
votes
2answers
2k views

#1115 - Unknown character set: 'utf8mb4'

When I Import Mysql from local server to web ser it is showng me error 1115 - Unknown character set: 'utf8mb4' in Creating wordpress wp_comment table CREATE TABLE IF NOT EXISTS `wp_commentmeta` ( ...
2
votes
2answers
416 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.* ...
0
votes
1answer
18 views

MySQL Select within WP Page template

I have one WP page which contains a form that posts data to a table in the Wordpress database called "members", data such as first name, surname, email, role and bio. Table posts fine and data is ...
0
votes
1answer
41 views

Check if a database is well installed

I tried to install wordpress under eclipse and xampp under ubuntu. I created the database (user: root, password: empty) by a sql command create database wordpress;, that is it. The wordpress seems to ...
0
votes
1answer
27 views

What are the issues associated with upgrading MySQL for Wordpress?

What are the issues associated with upgrading MySQL from 5.1 up to 5.5 for a server hosting multiple Wordpress sites? Will there be problems with the database after the upgrade? I have Plesk 12 ...
1
vote
2answers
34 views

How to get the total number of meta_values based on a custom post type?

I need to display the total number of votes that have been made for a specific custom post type. Here's an example of how the wp_postmeta table looks for these keys/values: meta_id post_id meta_key ...
0
votes
0answers
11 views

How to set max users to 17.000

For a website i need a range of user_id's from 10.000 to 17.000 I've already been able to set the minimum, but i'm clueless as how to set the maximum. I've been Googling around for a while now, hoping ...
0
votes
1answer
806 views

Create an user on external database

I have wordpress site and a project management system from codecanyon. Here is the link I have disabled registration for users in project managment system, only login is enabled. I need to make users ...
0
votes
2answers
3k views

SQL - Pull products of particular category from a remote WordPress woocommerce db

I connected to the db and successfully pulled products data. Now I want to to display products from specific category. The store is using woocommerce. The landing page is in different location so I ...
0
votes
1answer
13 views

Mysql SELECT posts

how i can get posts via MYSQL from posts where language is 'en' and 'ru' I have this query $sql = "SELECT p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1 ON ( wm1.post_id = ...
0
votes
0answers
17 views

Does WP query update accept variables being built into it?

Trying to figure out if this is a WP specific quirk. The var_dump code shows the correct string to be inserted but the last query dump at the end shows an incomplete query with no variable being ...
1
vote
1answer
427 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 ...
0
votes
1answer
36 views

Can I use mysql queries to replace query_posts()?

I have a template that seems to only accept variables given though query_posts(), which appears to work like get_posts(), but it's too restricting. So I need to either do it somehow without ...
0
votes
1answer
17 views

Changing Table Prefix for an Existing WordPresss Site

Hoping someone can assist with Wordpress table prefix for an already established site. What is the best approach in changing the existing table prefix within both DB and wp-config file to reflect new ...
0
votes
1answer
34 views

New post from database

I have data stored in DB (mysql) I want to creat new post for each row I have created custom post type with custom fields Beside xml rpc is there any other way. Cheers
0
votes
1answer
26 views

Create a new table on the database and save parameters from a contact form

I have a wordpress function in functions.php which gets parameters from a form I made and gets parameters like IP addresses and UTM tags (from the URL) and sends them to me by email. I want to get ...
0
votes
0answers
24 views

$wpdb how can i save my postmeta table before querying it

This function is in my functions.php file. The query returns the value I'm looking for via phpmyadmin, but only AFTER the function has been run in WordPress. add_action( 'transition_post_status', ...
0
votes
0answers
16 views

MySQL query in Functions.php using inner join to override/add to search

I'm setting up a radial geo-location search. I have users select a zipcode and a radius to search within. I want to use the regular search site.com?/s=abcd&zipcode=90210&radius=10 I look up ...
1
vote
0answers
39 views

Wordpress Deadlock Error

I see more of this error these days in error_log. I see that someone asked this question here a year ago but no solution. Please advise what is causing this issue. Already, tried deactivating some ...
0
votes
0answers
38 views

Create Database Tables on Plugin Activation hook

My function which have code for table creation function hotel_install() { $path=ABSPATH . 'wp-config.php'; require_once ($path); global $wpdb; $charset_collate = ...
1
vote
1answer
43 views

Convert simple SQL Query to WordPress query

I'm trying to 'batch' update the value in my post_parent fields in my wp_posts table. I can do it from within phpmyadmin using the following SQL Query: UPDATE wp_posts SET post_parent = '8' WHERE ...
1
vote
2answers
3k views

How to Query Database for posts with certain Taxonomy Term

I want to write a select query to return data on only posts which have are associated with the taxonomy term food-and-beverage SELECT wp_postmeta . * , wp_posts.post_name FROM wp_posts, wp_postmeta, ...
0
votes
0answers
15 views

Is it important to add Engine while importing database?

I am importing wordpress database sql file, but destination phpmyadmin not allowing to add ENGINE and CHARSET, But without that file imported and ENGINE, CHARSET is by default. Please tell me is it ...
10
votes
8answers
52k views

What SQL Query to do a simple find and replace

Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a ...
0
votes
0answers
10 views

Simple SQL Query in wordpress

I want to write a single SQL Query wordpress table wp_options With field name as option_value For table wp_options field, option_value, where i want to get user_id and its all associated images ...
3
votes
1answer
61 views

How to run WordPress across 2 VMs for high availability

Microsoft Azure requires that applications utilize two instances across multiple data centers in order to achieve their "high availability" SLA and ensure your sites don't go down for routine ...
12
votes
2answers
10k views

Should I use wpdb prepare?

I'm new to SQL and am wondering if I need to use wpdb->prepare for the following query to a table I've created global $wpdb; $tablename = $wpdb->prefix . "my_custom_table"; $sql = "SELECT * ...
2
votes
3answers
7k views

How to validate WordPress generated password in DB using PHP?

I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and to check user login, Logging users outside WP. I tried with md5 of password but it's not... ...
0
votes
1answer
20 views

Apache Redirect based on WordPress permissions

On our company website, we have two different types of download permissions: One for legacy, one for current. Is there a way for me to code a redirect through Apache that will query MySQL for the ...
0
votes
1answer
46 views

form $_post action value gets truncated after it passes through two forms

There are three pages page1, page2 and page3. When I press submit on my first form on page 1 my group name field can be catched with $_POST['groupname'] in the destination page but in the page 2 I ...
0
votes
0answers
21 views

include custom fields in search sql query

here is my sql query: add_filter( 'posts_where', 'title_filter', 100000, 2 ); function title_filter($where, &$wp_query){ global $wpdb; if(isset($_GET['s'])){ ...
0
votes
0answers
28 views

Passed variable gets undefined variable error on insert on next page

I am passing a variable with $_POST to another page and on the destination page I want to perform an insert operation and want to use that passed value . The variable "$mygroup" is coming from a forms ...