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

learn more… | top users | synonyms

2
votes
1answer
22 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
28 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
1answer
13 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
29 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
0answers
19 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
0answers
13 views

Workflow for developing an e-commerce website with Wordpress [on hold]

I need to develop a e-commerce type website with some typical modifications in it. I want to develop the front-end by myself and I need some extra functionality it, it will be something like a ...
0
votes
1answer
27 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
1answer
12 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
24 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 ...
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 ...
1
vote
2answers
33 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
11 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 ...
0
votes
1answer
10 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 ...
0
votes
1answer
35 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
16 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
25 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
23 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
1answer
33 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
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
36 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
32 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 = ...
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 ...
1
vote
1answer
40 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 ...
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 ...
0
votes
1answer
19 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
43 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
24 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 ...
3
votes
1answer
55 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 ...
0
votes
1answer
97 views

SQL Error wp_commentmeta - incorrect table definition

I'm trying to import a database and wonder how I can stop getting the following error? "#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key " ...
0
votes
0answers
10 views

Database level import of featured images and link to posts - How?

I have been attempting to import about 50,000 images into 50,000 posts in WP 4.2.2. The _posts table data is all correctly imported already. I know I need to import to _postmeta table and add new ...
1
vote
2answers
40 views

Database query works fine outside Wordpress

This is my code <?php global $wpdb; $rows = $wpdb->get_results("SELECT `submit_time` AS 'Submitted', max( if( `field_name` = 'Salutation', `field_value` , NULL ) ) AS 'Salutation', max( if( ...
3
votes
1answer
113 views

Use REGEXP in WP_Query meta_query key

I know I can use REGEXP in WP_Query like this: $query = new WP_Query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( ...
0
votes
0answers
24 views

Post count is wrong in all categories on backend and frontend

Admin area is showing wrong post count for all the categories (and I have 300+) It's showing more posts than they actually are, even for new categories with no posts at all shows like 5 or more. I ...
0
votes
0answers
27 views

wp_list_table, jquery get the value of the checkbox

Hello i'm trying to make inline edit for my wp_list_table. but i've hit a brick wall. the thing is that each elemement/td is made up off 2 class column example: <td class="name column-name" ...
2
votes
1answer
19 views

WordPress and automated MySQL backups to a different host

I'm having the following setup. A development computer in my local network and a production server with a real internet domain. Developing the PHP/CSS files on my dev computer for my theme is handled ...
0
votes
1answer
15 views

directorypress theme error mysql_error() [closed]

I installed directorypress theme to my wordpress site all works fine except this section " my purchase history" its sql error, but I can't deal with I want to remove this error or hide the link " my ...
0
votes
1answer
34 views

MySQL swap one table for another?

So I have a situation with this WordPress site I'm doing where I have to swap the positions of my featured images. I have two per post thanks to the Multiple Post Thumbnails plugin, but now whatever ...
0
votes
0answers
11 views

Mysql join 2 columns into 1

Hello i could really use a hand here.. the thing is i want to make 2 tables for a project - 1: Shifts: - which has: id, usr_id, date, start_time, end_time, and pending - 2: shifts_extra: - which ...
0
votes
1answer
37 views

How to set up an auto delete post?

I want to create a form in which when a front-end sets a date and on that date the post gets automatically deleted. Is it possible?
0
votes
0answers
9 views

MYSQL ignore categories on Wordpress widget

I have this WP widget that pulls random products from the DB. What I really want is to be able to include just a few products categories (or exclude). Can anyone help me? I appreciate. <?php ...
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` ( ...
-1
votes
1answer
29 views

Replace existing pages with new pages, keep menu links

I basically want a plugin or method that would give the same functionality as 'Enable Media Replace' but for replacing pages and posts, instead of redirecting, or manually editing. I've searched high ...
0
votes
3answers
141 views

Order By Multiple Meta Fields

I have two custom fields: meta_key1 is boolean (0 or 1). meta_key2 is a date value - 20150623 for example. Not all meta_key2 fields have an explicit value. It looks like their being treated as an ...
0
votes
1answer
100 views

Updating with $qpdb->query() always returns 0 rows affected

I'm experiencing an odd situation while running an UPDATE with $wpdb->query(). Given the users table, with columns user_id (Primary Key) and status, and the user 3 existing and with status 0, I ...