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

learn more… | top users | synonyms

0
votes
0answers
11 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
23 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
17 views

jquery is loading js scripts with 1 script for a few sec a good aproach?

so..... I want to make a dynamic table from a mysql query and i've done it successfuly but... I dont like the idea off people being able to look at my script files. Is there anyway to avoid this? My ...
0
votes
0answers
16 views

how to retrieve woocommerce product details based on their category_id using mysql -php

I have to retrieve the product details such as image title,description,image link and price from woocommerce table. I've retrieved the categories with this Query, $result = mysql_query("SELECT ...
0
votes
0answers
9 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
18 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
21 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
18 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
14 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 ...
2
votes
1answer
17 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
34 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
6 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
35 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
80 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
15 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
17 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
14 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
13 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
8 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
30 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
0answers
577 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
24 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
97 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
54 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 ...
0
votes
0answers
19 views

Delete all wordpress posts from db that matches a certain condition

Am trying to delete all posts from wordpress database, that are X days old and have a particular meta key-value attached to it. So simply something like this(pseudo sql): DELETE FROM `wp_posts` ...
0
votes
1answer
15 views

$wpdb returns duplicate posts

I have created a shortcode which shows the posts which were created after the user last logged in. The shortcode is working perfectly fine, but I am not sure why but I am getting 7 duplicate posts. So ...
0
votes
2answers
41 views

Saving custom term value to the database in new table

So I'm trying to save the value of a custom term to my database. The table is created as is the custom term. The code below outputs the text field onto my custom terms page but it just doesn't save ...
0
votes
0answers
28 views

Google-App-Engine[PHP]: Error trying to establish database connection

Hi to whom this may interest, I am finding a problem with the cloudsql as database connection is not being established. I have followed the following site step-by-step ...
0
votes
0answers
22 views

How to fix pagination issue on wordpress

I have a category with 2 subcategories. i have created a custom category template, to show the posts from the subcategories of that category, so it look like that: category page shows: Subcategory ...
0
votes
1answer
25 views

How to fetch all meta_key and meta_value using post_id wihout duplication of post meta using sql query

How to fetch all meta_key and meta_value using post_id wihout duplication of post meta using sql query. This query is repeting the post meta each time . $sql="SELECT * FROM wp_posts LEFT JOIN ...
0
votes
0answers
10 views

get_metadata() vs get_post_meta() vs custom query [duplicate]

I have 27 items of post_meta data that I need to get out in a class that I use through-out my website. Currently I'm using: $this->postMetaData = get_metadata("post", $postID); This returns an ...
0
votes
1answer
69 views

WordPress get pagination on wpdb get_results

How do I gee the numbered pagination of custom wpdb result? below code will show one latest post from each authors in the site. I want to show 20 posts per page with a numbered pagination. $postids ...
0
votes
1answer
30 views

worpress update post meta data(custom field) by post link

I have a post in my wordpress website, which has lot of custom fields. I have an excel sheet with "post link" - "custom field data" combination. That custom field(video url) is already set for each ...
0
votes
2answers
70 views

Show only one post for each author ( Page loads too slow )

I want to show only one latest post by each author and found this code that it working. However, it takes too long to load the page since I have over 100K authors and 100K posts in database. How can I ...
0
votes
1answer
25 views

Foreach only outputs if id is 0

I'm developing a plugin. On the activation hook i do this: /* Create category */ global $wpdb; $rpdb_category = $wpdb->prefix . "rp_category"; if($wpdb->get_var("show tables like ...
3
votes
1answer
76 views

Query both first_name and last_name from wp_usermeta at the same time

I'm trying to fetch both the first_name and last_name of all users at the same time, using the wpdb-object and the wp_usermeta table. I can't seem to figure out how to get both in the same query. ...
0
votes
2answers
140 views

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

After I upload my website on server, I got that message .. I searched on Internet and I found on Wordpress community this link , I followed the installation steps, the error message gone, but I got ...
0
votes
1answer
34 views

Files on Localhost, Database on Server

With Wordpress, is it possible to work on localhost but have the DB on a server? So that workflow will be: 1) Work on localhost (but connected to remote database) 2) Upload JUST files via ...
5
votes
2answers
132 views

Optimize Wordpress Query that take 5 seconds to execute

I have a large wordpress database: rows in key tables: 730K wp_posts 404K wp_terms 752K wp_term_relationships 27K wp_term_taxonomy 1.8 Million wp_postmeta The issue is that I have a query ...
0
votes
0answers
65 views

Count posts of child category in parent category

Hallo Wordpress Comunity, I need your help. I have a Woocommerce shop site with multiple authors. In the sidebar I want to display a list of woocommerce product categories by author (based on posts ...
0
votes
1answer
43 views

How to remove 'GROUP BY' from SQL query produced from get_posts?

Wordpress, Archive Cateory page. From default WP_Query->get_posts() we are getting something like this: SELECT wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = ...
0
votes
0answers
27 views

wpdb giving different results then query in SQL Editor

I'm trying to read candidates and the relation with expertises from 2 custom tables in my WP Database. This is my WPDB query : $candidates = $wpdb->get_results(" SELECT * FROM ...
0
votes
1answer
53 views

Wordpress page and plugin list using sql query

I want to get all published pages and activated plugins of my word press site,i want all pages and plugin using mysql query.i don't want to copy paste all pages from wp admin.i want to get this list ...
0
votes
0answers
12 views

Can tables in WordPress Multisite be combined?

I inherited medium size wordpress multi installation. At the time there were only about 20 different sites, each with their own set of database tables. We now have about 120 sites and over 3,200 ...
0
votes
0answers
59 views

MySql query to retrieve post_title, post_content and feature image link BASED ON A CATEGORY

I have been trying for quite a long time to retrieve post_title, post_content and feature image link for all posts BASED ON A particular CATEGORY, from a wordpress database. I have got a query: ...
1
vote
2answers
36 views

How do i fix? WordPress database error: You have an error in your SQL syntax;

I am Using Wordpress for making a website and getting below Error only on my pages and No shortcodes are working due to this error. This error ONLY seen on PAGES they are working fine on POSTS. I ...
0
votes
1answer
44 views

Alternative functions for mysql_free_result and mysql_ping in wordpress functions

what are the alternative function for mysql_free_result and mysql_ping in WordPress functions , does WordPress function provides all the functions like php ? is it necessary to Free result memory for ...
1
vote
0answers
45 views

mysql_real_escape_string() vs. esc_sql() in WordPress

Does mysql_real_escape_string() and esc_sql() in WordPress both do the same thing? I tried the following: $fetch_row='<p>And again for single posts</p>' echo mysql_real_escape_string( ...