Questions tagged [mysql]

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

477 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
276 views

$wpdb->get_results() does not fetch results with unicode 'WHERE' clause

I've just a simple query to fetch a students records by his name, written in Bengali. $student_rcrd = $wpdb->get_results("SELECT * FROM student WHERE name='আবুল কালাম আজাদ'"); Although my database ...
3
votes
0answers
1k views

Wordpress Deadlock Error

I see more of this error these days in error_log. I see that someone asked this question here a year ago but no solution. Please advise what is causing this issue. Already, tried deactivating some ...
3
votes
0answers
336 views

How to let a user choose an authors and save it to the database?

I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user ...
3
votes
1answer
2k views

How to merge local and live databases?

We've been developing for Wordpress for several years and whilst our workflow has been upgraded at several points there's one thing that we've never solved... merging a local Wordpress database with a ...
3
votes
1answer
1k views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
2
votes
1answer
116 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 ...
2
votes
0answers
36 views

Keeping database within limits, please help!

I have a website that auto generates odds data to mysql table via cron job every 2hrs. Over time the data in my table is exceeding the limit set from my hosting of 100mb. I want to stop my table from ...
2
votes
0answers
26 views

How to delete posts that does not have a thumbnail?

I have a problem with my blog. The thing is this, all the posts have a thumbnail in this address: wpbv_postmeta-->meta_key-->thumb And several (A LOT) of posts don't work, because I have made a ...
2
votes
0answers
433 views

Find duplicate posts with same slug and author

We imported over 250K posts into our multi-author WordPress database but have found duplicate posts where the same author has multiple posts with the same slug. Could you please recommend a MySQL ...
2
votes
0answers
36 views

Get the Plugin Which Triggered a MySql Query in Wordpress?

I am currently working on this plugin, which is similar to Query Monitor in which i Have displayed all the Details present in the $wpdb object. Now i need to find which plugin is Triggering the Query. ...
2
votes
1answer
3k views

Error: MySQL shutdown unexpectedly. XAMPP local conf running WordPress

I have a xampp configurated locally to run wordpress. I must have done something wrong when fixing some issues 'cuz at the end, I got stuck with the following log from mysql database. 2015-11-10 15:...
2
votes
0answers
217 views

Emojis getting converted to “?”

Emojis in posts and comments on a 500+ posts blog get converted automatically into single question marks in irregular and untraceable intervals. The respective tables wp_comments and wp_posts are ...
2
votes
1answer
388 views

AJAX in Wordpress, sending coords data to MySQL and show after into map

I've spent some months trying to figure out how to get users geolocation and pass it into MySQL and so after being shown with markers on the map. I've got stuck already in passing the data through ...
2
votes
0answers
212 views

Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?

I have table with foreign key reference and i recently changed the create table query with ON DELETE CASCADE $wpdb->query("DROP TABLE IF EXISTS $table_name2"); //CREATE TABLE ...
2
votes
0answers
2k views

Database with mixed collation (utf8mb4 & utf8_general_ci)

Each time I was uploading my WP install from offline to online, I was noticing strange characters in text and digging a bit I have discovered that wp-config.php on the online server was set to define('...
2
votes
1answer
458 views

Converting mysql to $wpdb

I'm trying to convert this to using a $wpdb class. It will return all the enums possible and i have to use this $wpdb due to mysql_query giving me weird error (no database selected) Code is following ...
2
votes
2answers
2k views

Gaining Login Access via the Database

I have been given a job to amend a Wordpress site. I have only been given access to Cpanel. My questions are can i log in to the back end of Wordpress via Cpanel? If you can't login via Cpanel can i ...
2
votes
1answer
52 views

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog. So I need your help to find the smartest solution to do it, ...
2
votes
0answers
1k views

Slow meta_query with about 4 milion record on wp_postmeta

Although optimized wordpress all the way but still very slow as follows : I have converted from LONGTEXT meta_value field to TEXT Then create INDEX for this field ALTER TABLE wp_postmeta ADD INDEX ...
2
votes
0answers
158 views

How can I make wordpress suppress mysql errors?

Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb? From what I've read setting WP_DEBUG ...
1
vote
1answer
10 views

Redirecting to old domain after migration website

Could someone help me with restoring my website (with new domain name)? I have a database backup and when restore it, wordpress is redirecting me to old website and domain. I changed site url in mysql ...
1
vote
1answer
22 views

Can I restart MySQL engine when WordPress website is live?

I'm dealing with resources processes problems in MySQL engine installed on an Ubuntu server, which hosts a WordPress website. So, I want to try restarting the service, will using the service mysql ...
1
vote
1answer
22 views

How do I see the mysql query generated by get_posts( $args )?

I'm trying to use get_posts( $args ) to get some custom post types. Is there a way to see the mysql query generated by the get_posts function?
1
vote
0answers
21 views

Woocommerce PHP site that shows table with orders from specific category

i want to make a PHP site for each of my deliverer that shows orders for them, im using querry like this to show orders: select p.ID as order_id, p.post_date, max( CASE WHEN pm.meta_key =...
1
vote
0answers
9 views

WpDataTables - View Image Directory

I made a form in PHP and it has an image upload that returns the image name in MySQL, and in the Wp-admin / wordpress folder. It is functional, so I created a column with URL Link in DataTables to ...
1
vote
0answers
22 views

Alter query with posts_clauses to retrieve NULL values last

I'm running a query to order my posts first by book's author, and then by book's name. I'm trying to achieve something like this : Author A : Book A Author A : Book B Author B : Book F Author C : ...
1
vote
0answers
16 views

get current date + 90 days and checking every day

User can submit post from frontend submission form. Fieldname: Title (entered by user) expire_date (entered by user) expire_date1 (invisible) expired (invisible) When user enter no value for "...
1
vote
1answer
71 views

WordPress post_status is future, manually added

My time zone is UTC+1. Now (and when the post creates the database): 2019-12-16 08:06:00 GMT (now): 2019-12-16 07:06:00 INSERT INTO `wp_posts` ( `ID`, `post_author`, `post_date`, `post_date_gmt`, `...
1
vote
1answer
21 views

join 2 table orders wordpress plugin

i have two table wp_wcfm_marketplace_orders wp_wcfm_affiliate_orders i need call data where wp_wcfm_affiliate_orders.orderid wp_wcfm_marketplace_orders.order_id it code call data table ...
1
vote
0answers
26 views

How to select from two different tables to display orders list with custom column from other table

I have a table which contains additional data about customers orders I want to create a table output on specific page when user loges in. when the user logs in I want to display to him all his orders ...
1
vote
0answers
28 views

How do I get create a custom table showing the hours remaining for all customers in one page from this transactions page?

[insert_php] global $wpdb; $current_user = wp_get_current_user(); $emailAddress = $current_user->user_email; /*$emailAddress = "samplethis@youguessedit.com";*/ [YADDA YADDA YADDA CODE] "; /* ...
1
vote
0answers
23 views

Remove shortcodes that are different (but same pattern) in each post

I have unused shortcodes in my posts like the following: [wp-imageflow2 dir=NokiaN868MP176] [wp-imageflow2 dir=Nokia6303classic97] [wp-imageflow2 dir=LGOptimus3DCubeSU87026] How do I remove them ...
1
vote
0answers
192 views

Slow queries constantly getting stuck on Wordpress database of ~100,000 posts

I am constantly getting stuck SELECT queries on my wordpress databases like the following: Many of the SELECT queries that get stuck are fairly ordinary, such as pulling the last 10 posts of an ...
1
vote
1answer
419 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, ...
1
vote
0answers
90 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 ...
1
vote
0answers
561 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
vote
1answer
15 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-...
1
vote
0answers
505 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 ...
1
vote
1answer
289 views

Order by summing multiple values

In a custom post type (products) I want to order products by summing multiple values based on user selection. I use custom taxonomies to filter the products. I could use the orderby meta_value but ...
1
vote
1answer
2k views

How to insert data into MySQL database from the form created in WordPress site

How can I insert the data entered into the form in WordPress site to the MySQL database? I have created a form in the site. I am able to run PHP codes using snippets but I don't know how to update the ...
1
vote
0answers
16 views

Randomised Post Time

I've imported a Drupal site to Wordpress with an archive of 1000s of posts which had been backdated by adding a custom taxonomy 'Year' rather than by adjusting the post date. I've been able to remove ...
1
vote
0answers
97 views

Wordpress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin

I am creating a wordpress plugin which upon activation i create my database table. I have an .sql file which has ~2000 rows of data and i would like to execute it after the creation of my database ...
1
vote
0answers
14 views

Ordering users by custom user meta

I have a list of users, and I would like to select a few to appear at the beginning of the "faculty" page, and then display the rest afterward in alphabetical order. With the following code (...
1
vote
0answers
113 views

How to implement a new row_count method in Wordpress?

Overview By far, Wordpress, Implements pagination by means of SQL_CALC_ROWS_FOUND. But my benchmark have shown that this implementation is 1.1 Million % slower than my queries without it. So I am ...
1
vote
1answer
18 views

A MySQL DB within a MySQL DB

I have a client who does not want to switch hosting providers. This provider only allows one database per client. I am setting up a sandbox for the client and do not wish to share the database across ...
1
vote
0answers
227 views

How do I query wp_options for expired transient pairs with MySQL commands?

I'm working on scanning the WordPress database from the MySQL CLI (so not using PHP to query) and getting results for expired or expiring transient pairs. The trick is the pairs have the same string ...
1
vote
1answer
83 views

How are multiple Wordpress WPDB queries handled?

In my code, I use this query to get all the rows where credited field is false: $uncredited_incentives_query = $wpdb->prepare( "SELECT * FROM $incentives_table WHERE user_id = %s AND credited =...
1
vote
2answers
3k views

How to get last updated row or ID in wordpress

How to get last updated row or ID in wordpress. Like : $wpdb->insert_id;
1
vote
0answers
242 views

Long running queries

I'm trying to build a PHP script that will pull the 10 most read posts (weekly) and will return me an XML file (so I can link it to Mailchimp). Im also using - Post Views Stats Wordpress plugin by ...
1
vote
2answers
69 views

Switching Databases in LocalHost

3 weeks ago I uploaded all my files from localhost to cPanel. I want to switch it back , the issue I facing is my original database from the localhost is not updated . I downloaded the database from ...

1
2 3 4 5
10