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
5 views

sql query page listing with option selected

I want to separate a page page from the sql query. for example current page and last page with option selected. my listing page code <ul class="list-group"> <h2 class="h3">...
0
votes
1answer
11 views

Get url of product's images (woocommerce)

What happen when a post (product) didnt have a guid,because it has the same image with another product ? For example: Query1: select guid from wp_posts where post_type='attachment' and ...
0
votes
0answers
39 views

PHP Fatal error: Uncaught Error: Call to a member function insert() on null

Hi I have an error that it's: Call to a member function insert() on null that the function $wpdb->insert(); returns. Now, this is my array:  Array ( [title] => Huqvarna 610 cross blocco ...
0
votes
0answers
12 views

Is it safe to convert tables from MyISAM to InnoDB?

I have inherited a WP site (with WP5.1 and WooCommerce 2.6.14, LearnDash 2.5.4 and few other smaller plugins). From screenshot you can see that it is a mix and match of MyISAM and InnoDB tables. ...
-1
votes
0answers
25 views

PHP Fatal error: Uncaught Error: Call to a member function query() on null

why $wpdb global returns null in this code? I can't be able to do the mysql query because the global is null. Below the error in the error log file: PHP Fatal error: Uncaught Error: Call to a ...
0
votes
1answer
27 views

PHP Warning: Error while sending QUERY packet

I have woocommerce website which give database error from 4-5 days. I checked the error log, the error is: PHP Warning: Error while sending QUERY packet. PID=31071 in /home/goldenwiggles/...
0
votes
1answer
24 views

Wordpress plugins for database queries

I have a handful of custom database commands that my admin users need to execute on an adhoc basis - it's some business logic that was unavailable in a normal plugin. The commands are all procedures ...
0
votes
1answer
30 views

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

I'm getting this message running PHP 7.2.18 Edit: If it makes any difference, when I run PHP from the command line using php -v, it says I'm running 7.3.5 I run this command to install: apt-get ...
0
votes
1answer
31 views

I can't update my data through $wpdb

I am trying to update my sql data through $wpdb, but can't... If anyone can help what's the real issue? $updated_version = $wpdb->update('wp_visitors', array('views' => $updated), array( '%d' ))...
0
votes
1answer
16 views

Trouble running $wpdb->query() with last_insert_id

I am trying to get a primary key from a coupon table to put it in my target table as a foreign key. In between I would like to run a query to get the last insert id. I can't get the syntax right ...
0
votes
1answer
21 views

A $_POST should occur when submit form but is not?

When I make a modification to data that is read into a form using MYSQL, I want to apply those changes to the database. But even when successfully submitting a form, the $_POST values are not ...
0
votes
0answers
7 views

avoid duplicate content after migration

I've done a full migration of two wordpress site (transferring bunch of blogs). I see that there are few blogs that have been repeated twice. Like, after moving old blogs from old to new sites along ...
1
vote
1answer
12 views

How can I perform high-level database merging for WordPress within continues delivery?

I've a bit of a problem. I'm currently trying to realize a WordPress development process regarding to one of my old question / topic: https://stackoverflow.com/questions/48890019/wordpress-...
0
votes
0answers
24 views

How to show galleries from a specific NextGEN album ID inside a custom WordPress page template?

I have a WordPress page template where all NextGEN galleries are displayed on a page: <?php global $nggdb; ?> <?php global $wpdb; ?> <?php $galleries = $nggdb->find_all_galleries('...
0
votes
1answer
20 views

Is it possible to create a WordPress table using array and loop?

I am trying to get all data fields name and data types from an array, but the query is not working. <?php $cr_table_array = array( array( 'data_field' => "id", 'data_type' => "mediumint(12) ...
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 ...
0
votes
1answer
37 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
18 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: ...
3
votes
1answer
60 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 ...
1
vote
2answers
142 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
44 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
18 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 ...
1
vote
0answers
20 views

How can I save unique user data on my site? [closed]

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
26 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
20 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
31 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 ...
0
votes
0answers
20 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
26 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
51 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
25 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
43 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
22 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
26 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
27 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
34 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
20 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
31 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
159 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
37 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
53 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
14 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
52 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
20 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
24 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 ...