The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

why is my postmeta table is so heavy

One of my database is realy heavy (+100Mo) for a site with not so many content (like 40 pages & 10 posts)). I found in phpmyadmin that my table "postmeta" is 95Mo. So i wonder to know what are the ...
0
votes
0answers
12 views

Executing PHP not related to wordpress - correct folder? [on hold]

I want to execute a php file that accesses databases that have nothing to do with wordpress. Many years ago i wrote a VB app on windows desktop that could access MySQL tables on a website remotely. ...
0
votes
0answers
34 views

update multiple rows in mysqli table base on two values

I know this is an old question that is repeated here a lot. but I couldn't find an answer that works, and my code is really bad. How can i update multiple rows in one query when i have to use two ...
0
votes
0answers
26 views

wpdb insert into point column in db

I am struggling to insert a combination of lat and lng into a point column in my database. I am trying the following, but i always get an error "cannot get geometry object from data you send to the ...
0
votes
0answers
21 views

find and replace shortcode sql database

I've been trying to replace this shortcode [RICH_REVIEWS_SHOW category=”all” num=”6″] with this shortcode [site_reviews summary count="3" hide="date"] but I'm failing miserably. I've used this ...
0
votes
0answers
67 views

Query product's image path by category WooCommerce database?

I am writing a small query to grab image path and object ID from Woo_Commerce database. I am join taxonomy and relationship table to achieve this but somehow I am making mistake I can't realize. I ...
0
votes
0answers
18 views

wordpress insert post without actions/hooks

I am developing a custom importer for WordPress (because we have a very custom setup and the available tools don't seem to work for our scenario). During this import, I'd like to disable any hooks ...
2
votes
1answer
89 views

Is it useful to turn on MySQL query cache for performance

Now the MySQL default query cache is disabled, as I remember long time ago, the hit rate of MySQL is quite high when running WordPress. So I am thinking if enable it now will improve performance, ...
0
votes
1answer
30 views

How to get the list of WooCommerce product image of a certain category from database?

I am trying to display WC product images (thumbnails) or just get the url to that image from database. But I can't seem to find the column where the url are stored with the following. One thing I want ...
0
votes
0answers
13 views

Warning messages appearing on website relating to ajax-portfolio/lib/gravity-fields [closed]

Hoping someone can assist, I have a website where I am experiencing the following warning messages and unsure what is causing this issue and how to rectify it. Warning: mysql_real_escape_string(): ...
-2
votes
1answer
24 views

Create a Wordpress Database query to find users who purchased specific product through WooCommerce [closed]

I am working with a company that provides online content in the form of semesters you pay to access. The semester is set up like a product that you purchase through WooCommerce. We've been applying a ...
0
votes
2answers
24 views

I want to share local developement and staging DB — Is this very smart or very stupid?

Basically: I want my work to be meaningful and efficient. I am considering making my local development AND staging database the same thing. I would develop on my local machine but have the SQL data ...
0
votes
0answers
22 views

SQL. Select category descendants

How does Wordpress fetches subcategories for a given category? I tried to figure it out from the code, but I have not succeeded. My real question is: is it possible to make some recursive sql query ...
0
votes
1answer
15 views

Error Connecting to Database WHEN Installing Wordpress on XAMPP [Tried All the Usual Stuff] (Pics Included)

Here's the error I get https://gyazo.com/56134064606564c836ae8b0f18a129ba Here's the DB login settings I used: https://gyazo.com/2facfe11765bc4b887c31bc111bb123a Here's my DB names and users: ...
0
votes
1answer
25 views

use mysql variable in a $wpdb->query to reindex a column?

I have this MySQL query, which do work in PHPMyAdmin: set @ROW = 0;UPDATE `wp_wpsstm_subtracks` SET `subtrack_order` = @ROW := @ROW+1 WHERE tracklist_id='176226' ORDER BY `subtrack_time` ASC I would ...
1
vote
0answers
42 views

Error: MySQL shutdown unexpectedly [on hold]

i see this error in my xampp/mysql/logs. what shoud i do? 2019-09-18 16:06:13 0 [Note] InnoDB: Completed initialization of buffer pool 2019-09-18 16:06:13 0 [ERROR] InnoDB: Cannot create log files ...
1
vote
1answer
39 views

Uncaught Error: Call to undefined function mysql_connect() - Wordpress installation

Trying to install wordpress without xamp on my local machine. Version info: Wordpress: 5.2.3 PHP: 7.3.9 Apache: 2.4.41 When accessing this url -http://localhost:8080/wordpress/wp-admin/install.php, ...
0
votes
0answers
60 views

Not getting ajax success response on insert/update row to database

I am not getting success response after inserting/updating record to the database. Instead ajax returning error: function(response) with Something went wrong! message. $this->gs_db is the ...
0
votes
0answers
8 views

Import Custom Taxonomy Tags From Custom Post Type To Post_Tags

I have a custom post type called 'Bookmark' which uses both the default Post_Tags and also have a taxonomy called 'Bookmark_Tags'. I would like to import all the Bookmark_Tags into the Post_Tags ...
0
votes
0answers
9 views

Sorting posts By Taxonomy using 'post_clause' filter

I have a table list in my plugin's admin panel that has taxonomy columns. I'm trying to add some sorting functionality for those columns and I'm using the post_clause filter to alter the query to ...
0
votes
1answer
12 views

MySQL update text field with '

I need to be able to have a charvar field that contains an apostrophe like Woody's. I'm using wp_list_table to simplify the editing of the table. After making the update, the field contains Woody/'s. ...
0
votes
1answer
14 views

One of two similar WP Query is very slow

I have two WP Query are very similar. one is fast and another is very very slow. I have already test two query via mysql directly. the fast one: SELECT wp_posts.* FROM wp_posts INNER JOIN ...
0
votes
0answers
13 views

Get count of posts by authors with Editor role between dates

I'm trying to find a query that can give me the count of posts made during 2019, but only if the author is an editor (I don't want posts by subscribers). I would like to also show the count by author'...
0
votes
1answer
24 views

Hide posts if user is added to it WP_query

I have this list of posts in wordpress. I've made a favorite function that when you mark something as favorite it gets added to the front of the line. The issue here is I run this 2 place. One top ...
0
votes
1answer
31 views

Check for $ _POST fields in a POST method form

I'm trying to check if the username and password fields are present in the login form. The problem is that the if (!empty ($_POST)) code does not do this to me. UPDATE: if (isset($_POST['submit-btn'...
0
votes
0answers
38 views

Wordpress mysql deos not work with php7

i have a vps with this specs : CPU Model: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz CPU Details: 4 Core (2200 MHz) Distro Name: CentOS Linux release 7.6.1810 (Core) Memory RAM : 8 GB i am running ...
0
votes
0answers
13 views

Updating post meta data - rapidly on every load

Disclaimer: This is simply a question not an issue. I think it's something worthwhile asking. The search-and-filter-pro plugin uses a defined URL on the my user shop pages so when someone filters the ...
0
votes
0answers
12 views

What is the MYSQL Query to bulk update the canonical URL of specific categories of posts in WordPress?

Thanks in advance for helping with this question. What is the MYSQL Query to bulk update the canonical URL of specific categories of posts in WordPress ?
0
votes
0answers
14 views

mamp upgrade database backtrace error

I use MampPro to setup my sites on the local server... all well and good. So, every time I fire it up I get the upgrade nag... so, I figure its time, and hit the upgrade... and it does its thing. ...
0
votes
0answers
19 views

Getting error “Warning: mysql_query(): Can't connect to local MySQL server through socket 'FILEPATH/cccatalog-plugin.php on line 1656”

I'm getting these errors on my Wordpress site: Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/89/10848999/html/wp-content/...
0
votes
0answers
12 views

Error establishing database after importing products to woocommerce

I'm trying to upload a total of 1500+ products in my site using csv and importing it through woocommerce. I have encountered this a few days ago when i tried uploading the total of 1500 products to my ...
0
votes
0answers
18 views

Find posts where the featured image is also inserted within the post body itself

I am looking to find all posts in my Wordpress installation that have the post featured image also embedded within the post body itself. Given that my theme shows the featured image and also of course ...
-3
votes
1answer
101 views

Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\admin\products.php on line 148 [closed]

<tr> <?php include('sql_connect.php'); ?> <?php $sql="select * from hp"; $query=mysql_query($sql); if(...
0
votes
1answer
18 views

How can i limit the number of posts to the most recent 6 in my query?

I have a crashing jQuery slider that i have been asked to fix. Currently it is loading 128 slides (causing crashed of course), but we only want to see 6. I tried using jQuery to remove() 7th and ...
0
votes
0answers
34 views

SQL query conditional from 3 tables

I've trying to get a SUM() value, and the statment works fine in MySQL query but not Wordpress function. In SQL is this select sum(meta_value) from `wp_woocommerce_order_itemmeta`, `...
0
votes
0answers
9 views

Grouping Upcoming Events and Past Events custom ACF meta keys

I'm having an issue grouping upcoming events and past events with their own specific headers. A Visual example of this would be: --- Upcoming events ---- event - - event - - event - - event - etc... ...
0
votes
2answers
72 views

How can I fetch data from another website to my wordpress website with mysql database

I can make wordpress website but I have an issue with this. I want to fetch data from another third party website to my own wordpress site with the mysql database. I want to fetch only one table with ...
1
vote
0answers
94 views

Mysql + Wordpress is killing my server (huge CPU usage and getting slow) [closed]

I have recently installed wordpress in a production server with 80K fields in wp_users registered, 175K fields in wp_post table and 350K fields in wp_postmeta. Problem is that mysql database is ...
0
votes
0answers
145 views

Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `wp_terms`

I have a wordpress site that has been working well for the past 6 years. Recently, I have been getting errors on: user creation tag creation I realized that user creation was yielding Duplicate ...
0
votes
1answer
24 views

Why does changing Database Table Prefixes result in loss of content?

As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database prefix from wp_ to wp_additional_prefix. To do this, I opened the wp-config....
0
votes
1answer
10 views

Extract all users along with yoast metadata description

We currently have a authors list page which shows all users which have at least 1 published post. Within this page I'd like to also show the description of the user, but take this from the metadata ...
0
votes
0answers
12 views

Crate SQL view in WordPress database from custom post types and fields

I'm trying to create a mysql view inside WP database that selects and then show some custom post fields. E.g.: with custom post types Movies and Reviews create an SQL view with movies name, ID and it'...
0
votes
1answer
18 views

Two different wordpress sites - same server and IP address. Gaining Access to database 1 of 2

Bit of an unusual request. I have a series of individual wordpress websites. they are not a multisite, as I need each to have unique domain names for the various sections of network. What I want to ...
0
votes
1answer
51 views

Fix wp_term_relationships slow query in get_posts

I used the Query Monitor plugin to find slow query on my WordPress site. The below-mentioned WP_Query->get_posts() takes about 0.3446 query time out of the total Database Query time of 0.3976. ...
0
votes
0answers
14 views

Checkbox that saves real-time value

Please help me as I create a checkbox that saves the value in real time and that appears on all pages if clicked or not. From already I thank you Sorry bad English <div class="toggle"> <...
-1
votes
1answer
25 views

$wpdb->get_var returns 0

I use following code to get a number : $where = 'WHERE type = 4 AND active = 1 AND user_id = ' . $user_id ; $user_followed = $wpdb->get_var("SELECT COUNT( * ) AS total FROM {$wpdb->tablex} {$...
0
votes
0answers
13 views

MySQL Actibity without any active visitors via Google Analytics

I am hosting a WP website on a VPS (Debian) and I noticed that my MySQL service is constantly being processed, even without any active live visitors that I can see on Google Analytics. I am aware ...
0
votes
0answers
20 views

Special character Wordpress search problem

i am faced with the following problem when using Wordpress Search. If i create a post titled "Try Something", with body "Hello testing t&y thank you". If i now take a look in my db, i see that ...
0
votes
0answers
28 views

Why is this function so slow?

My client has a WP website, its a real estate site with the properties setup as custom post types. Below is my search query to filter the listings based on a search form, all fairly standard stuff. ...
0
votes
0answers
19 views

Code to insert TAG taxonomy Wordpress

I made a grave error. I delete many TAGs from the database of my blog. Many TAGs were orphaned. And yet, unfortunately, many posts have anchor words that link to deleted tags. That is, several links ...