Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [mysql]

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

0
votes
1answer
33 views

WordPress insert query is not working : Showing no Error

Can`t insert data of form into the table, I have also tried other ways. Below is the code. <?php /* Template Name: The custom email */ ?> <?php get_header(); ?> <?php $sql = "CREATE ...
0
votes
1answer
16 views

How to get INSERT errors from $wpdb?

I have these $wpdb->suppress_errors(false); $wpdb->show_errors (true); $wpdbp = $wpdb->prepare($preparedQuery->query, $preparedQuery->values); $result = $wpdb->...
0
votes
0answers
10 views

Character encoding issues on some text

I transitioned a website over to another host. I am having issues with the database. It is encoded in latin1 I believe. Here is the table: However, on the post excerpt, the text looks like this: ...
2
votes
1answer
27 views

Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [on hold]

My client's website is moved from http to https, and I have updated most of the URLs using queries in phpMyAdmin, but I have been unable to update shortcode URLs. I have used the following query to ...
1
vote
2answers
129 views

Create Pages from Database

i've recently decided to create a website with wordpress. My goal is to a visualize data stored in a MySQL database. Each id in the database should represent one page on the website. From what i've ...
2
votes
1answer
30 views

Get WooCommerce product details and transfer them to a custom DB table

I'm currently doing a registering service for products with WordPress and WooCommerce. All products that customers can register will be in the WooCommerce database, but not visible on frontend. Here ...
0
votes
1answer
21 views

Delete all user's meta without knowing all the 'key'

Trying to delete users from the frontend - which I currently have working. Previously, I was manually deleting the metadata when it was completed. I was looking to see if it was possible to delete ...
0
votes
0answers
16 views

WordPress User Search Based on Latitude and Longitude

I am working on a project for myself whereby I am trying to search users within the WordPress database based on postcode/zip and radius but the code which I'm using takes forever to load and results ...
0
votes
0answers
8 views

Woocommerce web site 6-7 second pageloads

I have a wordpress based ecommerce website with Woocommerce. I use WP-Rocket Plugin for cache I use CND I use a Cloud dedicated server : 9CPU X 2GHZ 7GB Ram Apache For cached page ...
0
votes
0answers
18 views

How can I save unique user data on my site?

I am trying to find a way to allow registered users on my site create lists of data and save them. I'm having trouble finding a way to save the list they create to the database of my site. I am ...
1
vote
2answers
25 views

Removing a wordpress multisite installation and preserving the database before migrate to nginx

I have a WordPress multisite installation, and I need to remove the multisite, and keeps just the site ID 5 (domain.com/br) in the main address (domain.com). So I follow this tutorial to remove ...
0
votes
1answer
19 views

I would like some help wth an SQL query to link posts with categories

I am extracting data from my Wordpress database to analyse site structure. Works pretty good so far but I would like to include the posts main category in the table to enable further analysis. This is ...
0
votes
0answers
28 views

Wordpress Query optimaization for slow query

I've WP installation with some 120K posts. One of the slow queries that frequently appear at @mysql-slow.log is below # Query_time: 1.744827 Lock_time: 0.000567 Rows_sent: 1 Rows_examined: 635732 ...
-1
votes
0answers
19 views

Dynamically generate posts?

I am trying to put together a Wordpress site for a local sports team. The league has many players that change and instead of creating a different post / page for each player I wanted to have the data ...
-2
votes
0answers
37 views

How to store large amounts of data in a custom field

This question has been similarly asked before without any real conclusion. The LONGTEXT max for MySQL is 4,294,967,295 characters. But wordpress is refusing to save custom meta that is 2,000,000 ...
0
votes
0answers
19 views

how can i solve this problem? “wp_termmeta' doesn't exist for query SELECT term_id, meta_key…”

I do not know much about DATABASE. I am just a blogger. Two weeks ago, my blog is totally fine. but when I tried to pots new post, or when I tried to open existed post on homepage, I cannot post, or ...
0
votes
0answers
22 views

autocomplete in wordpress using ajax with json-data

The scenario is whenever client press the key, automatically the suggestion should come below the text box, and that suggested value is fetched from the database. Here i am stucked in a situation ...
0
votes
2answers
49 views

Way to bulk make all my tags lowercase?

Is there a way in mySQL or otherwise to bulk convert all my tags into lowercase? Thanks!
0
votes
0answers
21 views

MYSQL SQL syntax error on Wordpress Posts page

I see the following error on my Wordpress Posts page when I enable debugging. I only noticed this when I started adding categories to my posts and they were not saving. I never used categories before, ...
0
votes
1answer
31 views

Error inserting into custom table - Object of class wpdb could not be converted to string [closed]

Getting the above error when trying to insert into custom table .I am unable to find out what is the cause of the error. The error comes at line 17. Any help is greatly appreicated. The code is ...
1
vote
0answers
18 views

How to delete all customer user account that haven't placed a single order?

Recently I've had an influx of spam users registering on my Wordpress website and I am trying to delete them all if: they have a "Customer" role haven't placed at least one order before As I could ...
0
votes
1answer
23 views

Delete Users without a First and Last Name

I need to clean a WordPress Web site of SPAM users. I checked the Users list and noticed that valid users have a proper Name listed; SPAM users do not have that value and a - is displayed instead. ...
0
votes
1answer
25 views

SQL query to delete users with multiple meta keys and comments

I need help putting together an SQL that can delete users if they don't have (metakey1 or metakey2) and (does not have comments) I have this SQL which does it for single meta_key SELECT * FROM ...
0
votes
0answers
30 views

Display multiple meta_key/meta_values by single SQL query

This is my query SELECT P.ID, P.post_title, P.post_content, P.post_author, MAX(IF(PM.meta_key = 'ex_latitude', PM.meta_value, NULL)) AS lat, MAX(IF(PM.meta_key = 'ex_longitude', PM.meta_value, NULL)) ...
0
votes
0answers
19 views

Is it possible to replace MySQL with JSON files for WordPress

I'm interested in the question, Is it possible to replace MySQL database with JSON files for WordPress? Let me explain what I mean. We have 12 standard tables after WordPress installation. We can ...
0
votes
1answer
23 views

Order by custom table and multiplication

I want to order posts by multiplying values from a custom table. +---------+------+------+------+------+------+ | post_id | a | b | c | d | e | +---------+------+------+------+------+--...
0
votes
0answers
145 views

Wordpress MySQL Search and replace with wildcard?

I'm trying to search and replace for a link with wildcard in phpMyadmin. If I simulate this query UPDATE wp_posts SET post_content = REPLACE (post_content, '<a style="text-decoration:none" ...
0
votes
1answer
24 views

Getting Error Trying to Create Table

I'm trying to create a new table in phpmyadmin. I'm using MAMP and this is of course inside wordpress. <?php function testtheme_database() { global $wpdb; global $testtheme_db_version; $...
0
votes
1answer
33 views

SQL query to bulk change short code in all posts

PHP/SQL noob here. Based on this question I attempted to change some entries in phpmyadmin for my wordpress blog: I want to all galleries to link to file instead to file attachment (add link="file" to ...
0
votes
1answer
33 views

Windows Setup: Error establishing a database connection

I have MySQL 8.0.12, PHP v7.3.2 64Bit and Apache 2.4.38 64Bit installed. In theory I have everything that is needed to run WordPress locally. Through MySQL Workbench, I have tried the Host, Port, ...
0
votes
2answers
26 views

Where is the HTML-handler part in the wpdb class?

I'm trying to understand how datas are being handled when saving to the database in the wpdb class. I have searched for where HTML string datas are handled and found a method in the $this->query() ...
0
votes
0answers
10 views

How to display the last keywords used during 1 day (1 per post)

I want display the last keywords used during 1 day but 1 keyword per post. Like this: It's like the topics of the day. You can check the example in https://www.latercera.com/ <ul id="footer-tags"&...
1
vote
1answer
21 views

Bulk activate a theme on multisite

I have a multisite and a new theme that needs to be activated across all subsites. I found an answer by fuxia from 2012 and would like to know (1) if there have been changes in WordPress since that ...
0
votes
4answers
46 views

Remove a shortcode from all Wordpress posts

I changed a wordpress theme on an old site and removed all plugins which were unnecessary. All went well except for a shortcode that was used by the earlier author shows up on every post. For ...
0
votes
1answer
17 views

Exporting Post ID, Post Title, Primary Category and Primary Category ID

Trying to export the following data from WordPress or directory through MYSQL query. Post ID | Post Title | Post Content | Post Excerpt | Post Primary Category | Primary Category Term ID | Post ...
0
votes
0answers
20 views

WordPress Multisite IIS domain name bindings - error 404 and 503 - database issue?

I have two sites setup in my multisite setup, besides the main site, that are working with no problems. Each site is setup with a separate domain that I setup in the bindings in IIS. If I setup the ...
0
votes
0answers
19 views

Featured image from custom to Wordpress database

I want to adapt my old custom website database (composed of only one table) to Wordpress database. All data has been correctly imported in both tables (wp_posts and wp_postmeta) with a php code that ...
0
votes
1answer
26 views

How to show result of sql query in a page?

I have a table in the same DB that I have a WordPress page and I want to show in the land page the count of total of rows and then I need an another page that show the information of this table , How ...
0
votes
0answers
22 views

Issue with mysqli_set_charset

Every once in a while I get this error on my site. I currently have Debug mode enabled. I notice it more when I click on many links or make many updates to the website within a short time frame. Then ...
0
votes
2answers
24 views

Wordpress member notification

I try to implement a function to notify users about changes on the webpage. I tried to use sessions for that but it did not work very well. For example: A User can attend an event. To do that he has ...
2
votes
0answers
48 views

Too many datadabse connections - upper ceiling mysql

We run a high traffic blog with around 500 real-time users and 10000 posts. We are hosted by self on VPS - 16gb, 4 core with separate mysql DB server - 4gb, 2 core; both SSD. No problem with hosting ...
0
votes
1answer
44 views

Need help with format of nested array in MySQL

I build a plugin, that is able to run through a CSV file and parse the variables into custom fields of a custom post. In my custom post type, I build a meta box with repeatable custom fields. The ...
0
votes
0answers
14 views

Integration between Datatables Server Side Processing and Wordpress

I have a created a table using Datatables and a simple SELECT query from my Mysql database. I realized that for big amount of data, it's better use server side-processing to speed-up the records ...
0
votes
0answers
7 views

Creating search page based database information

I am new to WordPress but not to web development. I have a mySQL database of information of products, and I want a user to be able to enter in a search bar for a product and all products containing ...
0
votes
0answers
14 views

SQL Query to delete featured images in particular post type within a specific date range?

I saw this answer... Query to delete all featured images and remove post meta? ...but it deleted ALL featured images and post meta. I would like to do the same for all "events" posts created by ...
0
votes
1answer
36 views

DELETE WooCommerce Order data from database

I spent some time in my DB trying to figure out how I can clean out some completed order data. Below is the query that I am confident will help remove the data from completed woocommerce orders. My ...
0
votes
1answer
14 views

Sorting query_posts() with a complex orderby filter

I'm trying to order my posts with a complex orderby scenario which uses the CASE and WHEN syntax. To achieve that, I've created a filter : add_filter( 'posts_orderby', 'order_properties_by_reference',...
1
vote
1answer
18 views

Change the category of all posts in it

I'm trying to make a category change of some posts by MySQL. But I am not able to give the update in the database, it is giving error when running the query. UPDATE * FROM mooca_posts LEFT JOIN ...
0
votes
0answers
9 views

getting the list of main product pictures

I want to remove the background from the main picture (the picture that shows up in catalog) of all my products. I want to get the list of these pictures. I know all the picture are in wp_posts table ...
0
votes
0answers
33 views

WordPress asks to install, but is already installed?

I know this has been resolved many times including here, but I can't figure this out in my case. I've been using XAMPP for Mac on Mojave and recently, I updated it to the latest version of - 7.3.1. ...