Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
49 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
247 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
1k 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 ...
-2
votes
1answer
76 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
31 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
39 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
19 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
2answers
58 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
142 views

Error: MySQL shutdown unexpectedly [closed]

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
427 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
253 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
27 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
21 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
29 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
49 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
24 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
31 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
173 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
58 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
24 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
25 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
21 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
37 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/...
-3
votes
1answer
2k 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
23 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
2answers
359 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
514 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
1answer
63 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
22 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
1answer
106 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
466 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. ...
-1
votes
1answer
53 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
32 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
1answer
24 views

create new users in db starting at what ID?

I have to create several hundred users using mysql. How do I know which user IDs to give them? I don't want to duplicate already-in-use IDs, so is there a way to check which IDs are safe to use for ...
0
votes
1answer
195 views

Update or insert meta key value - On Duplicate key update

I need to bulk update some meta descriptions and have found that some of the posts don't have them so I need to do an update or insert query. (Once I get this query right I will be creating a temp ...
0
votes
1answer
29 views

Delete a custom field in mysql for all posts with specific category id

Delete a custom field in mysql for all posts with specific category id I am trying to delete all custom fields with the key 'key1' from posts that are in category id '66'. I can delete all custom ...
2
votes
2answers
144 views

How can I free up the memory used by update_post_meta?

I've noticed that each call to update_post_meta results in a small increase in my memory usage. Normally, the increase is small enough to not matter. But I'm writing a CSV import function that calls ...
0
votes
0answers
27 views

Login issue in Wordpress

I'm facing currently an issue with my wordpress site, i don't know exactly what happened but when i try to login from /wp-admin i enter my password and i connect, but naturaly after the session dies i ...
1
vote
0answers
93 views

Return terms from multiple taxonomies using $wpdb

I would be the first to admit that I know next to nothing about SQL queries, but after numerous searches and some trial and error I was able to cobble together a query that returned the results I was ...
0
votes
1answer
41 views

Change upload URL by mime type

I'm working on a site that has several hundred pdf files uploaded over the course of a few months. All uploads are organised in the uploads directory by year/month. The client has just decided they ...
1
vote
3answers
262 views

$wpdb -> Batch insert from XML File?

Actually im stuck on this! XML-File ~ 140.000 Rows Filesize ~ 9.0 MB LOAD XML INFILE 'file_name' isnt't allowed ( shared hosting! ) The supplier provides a single XML file with quantity and sku. The ...
0
votes
1answer
271 views

Is a MySQL DATETIME or TIMESTAMP value retrieved through $wpdb in UTC?

I have a custom MySQL table with two columns that look like this: `timestamp_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `datetime_created` DATETIME DEFAULT CURRENT_TIMESTAMP, When retrieving ...
0
votes
1answer
36 views

Changing root password in PHPMyAdmin for Wordpress Database when going live

Is it a good idea to create a password and make your password secure for your Wordpress database when uploading the database to a third-party web host (going live instead of hosting on localhost) ...
0
votes
2answers
38 views

Setting up Wordpress Locally on WAMP for a new site (with one already)

Here are the steps I took in downloading and setting up WordPress on a WAMP (Windows, Apache2, MySQL, PHP): 1.) Download WAMP Server, here: WAMP Server Installation 2.) Download WordPress on ...
2
votes
3answers
9k 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
1k 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 ...
1
vote
0answers
568 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
1answer
1k 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
556 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 ...

1 2 3
4
5
29