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

Questions tagged [mysql]

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

0
votes
0answers
14 views

Wordpress mariadb - should I use Aria table type?

I've been reading about the benefits of Aria table type in MariaDB (we use mysql Ver 15.1 Distrib 5.5.60-MariaDB), which seem to be simple and fast, yet crash-proof, take on MyISAM. Which makes me ...
0
votes
0answers
5 views

WordPress, WooCommerce wp-admin BackEnd work speed of response issue

Product Uploading: Limited by uploading 1000 products per instance, if more the process is freezing. The more uploaded products a vendor has the slower new products uploading speed. Product Uploading ...
2
votes
3answers
2k views

Removing the first image in content

I've been using this code: function remove_first_image ($content) { if (!is_page() && !is_feed() && !is_feed()) { $content = preg_replace("/<img[^>]+\>/i", "", $content, 1); }...
2
votes
1answer
30 views

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

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 ...
0
votes
4answers
1k views

Error establishing a database connection - with Debug Data

my site started acting up a few days ago, running the debug I get these lines. Tried to mess around with the DB but couldn't get my head through it. Do you have any idea what those lines imply? ...
0
votes
1answer
35 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: ...
0
votes
2answers
756 views

You have an error in your SQL syntax - Help with query

I have a programmer that developed a custom plug in for a client's website and after moving the site to client's server, some parts are not working. Looking at the error log, there is an issue with ...
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
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 ...
1
vote
2answers
232 views

Wordpress Backend HA (Automatic failover)

Out setup is multiple Front Ends (replicated) and 2 Backend MYSQL servers (Master-Master replication). We're looking to achieve HA automatic failover for wordpress. We've got the front ends covered ...
1
vote
2answers
131 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 ...
8
votes
5answers
12k views

Checking if Database Table exists

I read the wordpress codex and professional wordpress. It seems both use something like if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { to determine if the table exists. Is ...
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
1answer
378 views

The function is deprecated; use mysql_real_escape_string() instead

I don`t know coding. I recently my website stop to work properly. I get this error on the top of on every page loaded. Deprecated: mysql_escape_string(): This function is deprecated; use ...
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 ...
1
vote
1answer
380 views

MySQL variable in query

I've got tenant portal when I need to show running balance for each transaction. Here's query I've written which does what I need it to do. Problem I've got is that it doesn't work in Wordpress. Here'...
1
vote
0answers
19 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 ...
1
vote
2answers
6k views

MySQL Query to Retrieve Category from wp_posts

Using this query to retrieve all of my posts with a specific post_type SELECT * FROM wp_posts WHERE post_type = 'product'; As described here the category is not in the wp_posts table but in term ...
0
votes
0answers
29 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
20 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
1answer
451 views

Merging development site with live site

Earlier this year I built a client a large website for their organization. After that site was finished and live on the web (not on our development server anymore) they wanted the company I work for ...
1
vote
1answer
406 views

PHP script can't connect to Database on port 3307

I can connect to mysql just fine with my port number through the command line like so: mysql -h ##.##.##.## -P 3307 -u wpuser -p I have a php file that tries to connect to the DB, <?php ...
0
votes
1answer
413 views

Deprecated: mysql_connect():

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/gorilla911/public_html/wp-includes/wp-db.php on line 1520 ...
0
votes
1answer
271 views

Hacked Wordpress website /Homepage redirect

I am very sorry about the length of the post, please bear with me as I am going to try and list everything I've done so far. I am dealing with a hacked WordPress site which had been left without ...
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, ...
4
votes
5answers
11k views

Wordpress Database lost auto increment

After rolling back a Wordpress database to a backup version it seems that all the tables lost their auto_increment on the primary key columns. I read on another post this could be to do with InnoDB ...
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 ...
0
votes
1answer
414 views

Copy wp_postmeta from one database to another

I had a site setup on old-domain.com, which used the database old_db. Recently, we had to migrate our website to a new server and domain, new-domain.com which uses the database new_db. I installed a ...
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
412 views

Plugin MySQL SELECT custom data and filter on user meta

I'm porting a custom PHP feature to be part of a Wordpress plugin. At present, my USERS table has a field (let's call it FLAG) which my MySQL query needs to filter on, eg: SELECT custom-data FROM ...
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
417 views

How to securely provide a $_POST var in WP_Query with PHP 7?

In PHP 5.5 you had the function mysql_real_escape_string() and I always did htmlspecialchars(mysql_real_escape_string($_POST['...])); to secure against SQL-Injection. With PHP 7 ...
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
1answer
455 views

Insert double entry in DB

I created plugin and my plugin create new Table in DB. My problem is when user type something in field firstname, lastname... and click on button Submit, that go to my table and that is ok.. but then ...
1
vote
2answers
441 views

$wpdb select all meta for each post

I'm running the following query trying to get the data and associated meta data of a huge number of posts: SELECT wp_posts.post_title, wp_posts.post_date, wp_posts.ID, wp_postmeta.post_id, ...
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 ...
1
vote
1answer
434 views

UPDATE on SELECT results. A SQL query to swap Author with Meta Box value

I inherited a project where, for some reason, the previous developer make a custom post type for authors and a custom select listing all those authors cpt titles in the post edit screen. This led to a ...
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
1answer
469 views

mySQL statment count of post in each category and sub category

im trying to get a count of all post for each Categorty and sub category it should show main_cat 10 -a1 5 -a2 5 i have tried this but my counts are all of and im getting ...
0
votes
1answer
464 views

How can I export posts with featured images, without download them

Exporting posts with featured images without downloading them. I work with a site that has 10000 media in a blob and nothing is allocated in the uploads folder. How do I export the posts without ...