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

learn more… | top users | synonyms

0
votes
0answers
13 views

Check role in database

I'm developing a script outside of Wordpress that needs to work with the Wordpress database and our website. I just need to check if the role of a user is our custom role (already defined) of ...
0
votes
1answer
11 views

Making CURDATE() recognize current_time()

I'm trying to make this query pull a list of users 30 days from today that have a birthday. This query works as per below in WordPress, but excludes those who have birthdays as today. I believe the ...
0
votes
0answers
12 views

Database solutions for a commenting plugin?

(I'm new to this and am aware that my questions are vague and kind of suck, please bear with me.) My plugin, a commenting platform, is in the directory. Currently, it doesn't have it's own database. ...
0
votes
0answers
13 views

Close secoundary database connection

I have two website. first one is in wordpress and second one is in corephp. My Question is that i am connection database by $wpdb. /* Core php database */ $newwpdb = new wpdb( 'username', ...
0
votes
0answers
10 views

Incorporating a meta query into a mysql query in wordpress

I'm trying to find a way of inserting a meta condition into this bit of SQL below... $query = "SELECT COUNT( ID ) as num_events " . "FROM $wpdb->posts " . "WHERE ...
0
votes
2answers
31 views

get_results suddenly not working on a single table

I'm trying to get a list of rows from the DB. All tables work except the one I need. No errors are thrown, don't even get a blank array. My SELECT statement works fine in phpmyadmin directly, but not ...
0
votes
1answer
14 views

How to change the publishing date of each posts?

I need to set the publishing date of many posts with the post date (the creation date). I know that I can do it editing the single post and changing the Published on value but this procedure is ...
0
votes
0answers
10 views

How to handle this problem related to the publishing date of imported posts?

I have the following situation that I have to handle: I imported some posts from an old custom blog (not WordPress, a custom blog made using ASP). I exported in CSV format the content of the table ...
0
votes
1answer
13 views

What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?

I have the following doubt related to the posts table of the WordPress database. I see that when I create a new post in this table are automatically created 2 new rows. 32 1 2014-08-16 15:07:22 ...
0
votes
1answer
13 views

Why when I create a new post I found 2 record related to this post into the posts database table?

I am very new in WordPress development and I have a doubt about the WP database table named posts I have observe that when I create a new post (into the WP administration panel) are created 2 record ...
0
votes
2answers
16 views

Will reducing mysql permissions hinder WP function? [duplicate]

While installing WP, I created a mysql user to access only the relevant WP database. It's likely that not technical people will end up with access to this account, so I decided to remove DELETE and ...
0
votes
1answer
23 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 ...
-3
votes
3answers
28 views

how to show the data from a myqsl database in a post [closed]

im new with using wordress. I am trying to make a website that would show the data table from my mysql database. or is there any free plugin that will be able to do this?
0
votes
0answers
29 views

Exclude posts from certain meta_key

I have query to retrieve all posts, but how can I check the condition for post meta_key ="develop" and meta_value='anything' SELECT DISTINCT date(p.post_date) as post_date FROM $wpdb->posts p ...
-1
votes
0answers
11 views

Wordpress - Woocommerce - File server load balancing [closed]

My site using wordpress + woocomemerce and sell digital product (downloadable). How to setup load balancing - one server for web + mysql and other for process download file. Because woocommerce store ...
1
vote
0answers
27 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 ...
0
votes
1answer
16 views

How to pass username into form that sends data to database

I am trying to pass username to database through form: [insert_php] $current_user= wp_get_current_user(); $id= $current_user->user_login; [/insert_php] <input type="hidden" name="id" ...
0
votes
1answer
44 views

Adding data to custom wordpress database table

I have a form on a page that populates the database table: <table border="1"> <tr> <td align="center">Form Input Employees Data</td> </tr> <tr> ...
0
votes
0answers
10 views

How to connect database table to each registered wordpress user.

When registered user visit certain page, I want him to be able to add some 3 column data to a database that can be retrieved for him later. The way I see it implemented is by automatically adding an ...
0
votes
0answers
11 views

why ’ quote double quote in database wordpress

i'm trying backup and restore database using php code. but i don't know why quote double quote show in database wordpress, something like ’, and destroy my wiget_text. So how can i fix that.? help ...
0
votes
1answer
41 views

Complicated MySQL Query

I'm trying to build a directory of members that has some search options at the top. Each member has several custom fields as well (using Advanced Custom Fields). Would like to have a single query ...
0
votes
0answers
47 views

Can't Post to my Wordpress Anymore!

I'm at my rope's end with this whole thing and have tried everything I can to solve it. I have a WordPress site with a SQL database on Azure, but recently all of the users associated with the site ...
0
votes
1answer
12 views

how to insert missing tags into the posts through mySQL?

I am looking for a SQL query to insert a tag to multiple posts from a specific category. A pseudo query looks something like this: INSERT INTO POSTS VALUES TAG = "tagName" where Posts ...
0
votes
0answers
16 views

new multisite, old db

I'm trying to get my old posts from a WP install that was in a sub-directory on my site, into a new Multisite install on a new host. The new install is doing what it should. the problem is the posts ...
0
votes
0answers
11 views

Wordpress Database Duplicate Entry Error (Cron specific)

This is one error that my website is continuously generating in the error log file. WordPress database error Duplicate entry '59199038' for key 'PRIMARY' for query INSERT INTO `admission_options` ...
0
votes
1answer
60 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
41 views

Slow Wordpress admin panel with a total query time of 1664ms

I have a problem with my wordpress website, he is realy slow, i installed a debug bar to check queries in the home page, the result is like: 202 queries, and a total query time equal to 1665ms The ...
0
votes
0answers
18 views

Getting categories from DataBase & WP Favorite Post

I am trying to create a shortcode that pull the most saved posts (using WP Favorite Post) and displaying them by YEAR, MONTH or CATEGORY. So far I have been able to get the year and month working ...
0
votes
0answers
11 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, ...
0
votes
2answers
42 views

How many Wordpress SQL Queries per page?

I am on a shared hosting which has a limitation at MySQL queries per hour. My shows unable to connect to database because of this. Can anyone tell me how many queries are per page on a wordpress site ...
0
votes
0answers
25 views

Get a list of the last posts grouped by author and filtered by category

i need a list of the latest post published by various authors, but filtered by category, like for example the latest posts of author that write about music. i wrote this query and looks like working ...
0
votes
1answer
29 views

retrieve wordpress post-meta using php not wordpress functions

I am trying retrieve wordpress postmeta USING PHP not WORDPRESS functions, it needs to be in php no wordpress functions please. this is what I have: $resultat = mysqli_query($con,"SELECT * FROM ...
0
votes
1answer
34 views

Which is better and faster ? Wordpress Queries or SQL Query

Suppose I am developing a minimal theme, the the post page single.php displays only the post title, the excerpt and the content. So in general that would be <?php the_title(); ?> <?php ...
0
votes
2answers
64 views

mySQL queries are executed twice on wordpress website

I'm sorry for my english. I'm trying to add some functionalities at my Wordpress website and to do this i have added a function in my function.php theme. The idea is to save in a custom table some ...
0
votes
1answer
22 views

WP_Query hit max joins… How else can I build a search function that uses custom fields?

I'm trying to search a custom post type of "Properties", while doing so I'm also searching the custom fields using multiple (anywhere from 5-30) meta_queries. The problem is Wordpress or MySQL is ...
1
vote
2answers
72 views

Add “Category” to Mysql Query

i need your help :) I've made this custom Mysql query on WordPress: $querystr = " SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id IN( SELECT DISTINCT ...
0
votes
0answers
35 views

Writing directly to WP_Posts table

We directly add posts to WP_Posts table using filemaker. Once the post has been published, however, wordpress seems to be disregarding the existence of certain fields. For example, we have data in ...
0
votes
1answer
28 views

Get author posts count after excluding a category

I want to display the posts count of each author, but posts that are in some categories should be excluded from the count. I tried doing this with count_user_posts( $user->ID ), but this function ...
0
votes
1answer
33 views

Adding custom tables to Wordpress

I have a database which has thousands of rows of data in each of the tables. I would like to migrate this database into a Wordpress website. I would like the user to be able to log in to Wordpress ...
0
votes
0answers
22 views

Does Anyone Know How To Shard A MYSQL Database With HypderDB?

I have a woocommerce site with 80,000 products. It's on pretty speedy VPS (8GB RAM, 4CPUs, SD hard drives) and it's configured pretty well (nginx, php-opcode caching, w3 total cache, etc.) but when ...
0
votes
0answers
35 views

How to fetch post and related information from post and postmeta table in WordPress?

I want to fetch post information and its related meta information in WordPress setup. Is it possible from single SQL Query? Post table columns: ID, post_title, post_content Post Meta columns: meta_id, ...
0
votes
0answers
41 views

Importing data from database to WP_list_table

How can I import data from a table where Ive got : ID, Name, LastName, Adress and class and by the way, how do I create this plug-in? Any examples?
0
votes
0answers
17 views

Is MySQL query_cache useful for WordPress?

Starting from 5.6, if you use InnoDB as the default engine and query_cache is now officially disabled. We've a quite moderate traffic wordpress site and experience a major downtime when we upgraded ...
0
votes
0answers
54 views

call stored procedure without parameters

I asked this question last week, but then I deleted it because it was stated to be off-topic because I use a function within buddypress. However, I am convinced that whatever I am doing wrong is more ...
0
votes
1answer
31 views

Active DB queries in Wordpress?

I just make some researches regarding to wordpress DB queries and I just wonder if I miss something a normal SELECT query for example in Codeigniter with active records would look like if I assume I ...
0
votes
0answers
32 views

Populating a form with SQL queries

Being a 'learning by example' kind of guy, I've populated a form using this code; <?php $meta_key1 = 'area'; $postids = $wpdb->get_col( $wpdb->prepare( " SELECT ...
1
vote
1answer
52 views

No wp-config.php file on local install of wordpress - site still displays

I've installed Wordpress locally using XAMPP and this step by step guide by Sunny Johal(Fifth post down on that page). The first time I used the step by step and ran all 3 of the SQL codes(UPDATE ...
0
votes
0answers
41 views

Change post category via MySQL

I'm currently building a management program that works separately from Wordpress but interacts directly with the Wordpress MySQL database. I have it working updating, adding and deleting posts and ...
0
votes
1answer
25 views

Why this query is not showing any result on wordpresss home page?

I am learning wordpress database, And I have written this query for showing the data from the post table with id=2, but not showing anything. What is wrong with the following query? please help. ...
0
votes
1answer
57 views

How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?

Problem Summary: I am trying to write a SQL query that returns only my custom taxonomy terms, but the table (wp_terms) contains all of the terms, even ones that I don't want (such as category terms, ...