Questions tagged [mysql]

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

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

Performing CRUD operations on front end in wordpress

I'm currently trying to create a system where I can perform CRUD operations on a wordpress front end. I've seen a few plugins with shortcodes that allow this, so that is one possibility. However, ...
0
votes
0answers
10 views

Woocommerce Get Orders By Meta Value

I have orders, some of them has meta value is set 0. Please see my attachment To filter out orders based on meta value, i am using below code... add_action( 'pre_get_posts', function( $query ) { ...
0
votes
0answers
7 views

How do I connect to a MySQL container from my PHP container so I can run my wp-cli command?

I am using wp-cli and trying to run the wp command wp config create --dbname=wp_database --dbuser=wordpress-user --dbpass=password-example --locale=en_GB I use a similar Docker environment for Laravel ...
0
votes
0answers
15 views

Calculating a large number of MYSQL queries as customshort codes, slow

I am using wordpress and building a dashboard. There are a lot of complex MYSQL queries that I am running in order to return results from the DB. I am returning these as custom short codes in ...
0
votes
1answer
13 views

email alert for product availability

I want to give the user the possibility to click a button when the product stock is 0. the idea is to send an email to the user as soon has the product has been restablished. I can make this farely ...
0
votes
0answers
20 views

when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool

WP version 5.5.3 - updated days ago php version 7.3.24 running locally on server Can not create a backup using duplicator Occours bothi inside WP admin pages, so internal connections and external ...
2
votes
1answer
31 views

How can I list only sites that use a particular theme or plugin?

I need to search through dozens of WordPress multisite (network enabled) installs for sites that use a particular plugin. How can I list only sites that use a particular theme or plugin, preferably ...
0
votes
0answers
19 views

Remove all \n\t from $wpdb->prepare()

If I have a prepare method with a lot of fields like the one below, to make the code more usable and clear, I always separate the rules of my query with newlines, but if I have problems with these ...
0
votes
1answer
21 views

Update post if exist from PHP

I want to publish post from php for automation reasons with dynamic data and cronjob. I have almost succeeded, you could say that it works, but in an incorrect way. If the title doesn't exist, create ...
0
votes
1answer
23 views

wpdb COALESCE won't work

I am struggling to get the result using COALESCE from custom table. I need to run a second query if the first results null but wpdb resulting query string itself rather than the result. $query = "...
0
votes
0answers
16 views

Lock wait timeout exceeded; try restarting transaction

I get the bottom error in the debug file. I don't know how can I solve it! خطای Lock wait timeout exceeded; try restarting transaction در پایگاه‌داده وردپرس برای دستور INSERT INTO `wp_options` (`...
0
votes
0answers
13 views

Constant Error establishing a database connection

Our websites are having database connection issue. All the database credentials are correct. The sites work just fine for a while, then suddenly, there is a database connection issue and shows the ...
0
votes
1answer
18 views

How to run SQL query from Wordpress 'WP Crontrol' plugin

I have a SQL query which does exactly what I want if I run it directly in the database: UPDATE wp_pmpro_memberships_users SET wp_pmpro_memberships_users.status = 'admin_cancelled' WHERE ...
0
votes
0answers
9 views

How to break long paragraphs using MySQL [duplicate]

What is the easiest way to add a line break in the wordpress post_content, if the paragraphs are too long? My thoughts are explode the post_content by "\n\n" get the length of the pieces. ...
0
votes
0answers
20 views

Add Line Breaks in Wordpress Posts with MySQL [closed]

i try to add line breaks in a bulk proceess to wordpress posts, if a sentence ends with ":" I search for the next "." punctuation before ":" and try to add a "\n\n&...
0
votes
0answers
18 views

Updating (incrementing by X) all IDs in my WordPress

I'm making a complete redesign of a WordPress site in a new fresh WP installation. This site is an eCommerce one with WooCommerce, so I need to export ALL the WooCommerce data from my old site to be ...
0
votes
0answers
25 views

Improve performance by removing unnecessary database queries

I've just found out that main page of custom theme im developing does 150 db queries on every load (what takes even 2.5 seconds). Many of them come from functions.php, and are caused by for example ...
0
votes
0answers
11 views

like statement for <?php $current_user->user_login ?>

I have a mysql query the gets data based on the user_login. We've recently upgraged to allow multiple users from a company to access the site. The main login is 5 characters and additional users ...
0
votes
0answers
21 views

I wanted to Know that how can I give ingore to 0000-00-00 in my config file

I wanted to know that how can I give ignore to 0000-00-00 in my config file so that I didn't get an error of invalid value for this Zero-Date 0000-00-00 in my site database.
0
votes
2answers
22 views

What is my error trying to create a new table in the database?

I tried creating the tables in different ways and I always get the same error: "Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ...
1
vote
0answers
23 views

Wordpress Query is taking more then 20 second and stuck on creating index

Hi I need help with below query this query takes around 20 second and when more then one is executed then server CPU usage hits 100% and server stop responding. here is the query from process list. ...
0
votes
1answer
33 views

I imported an restore an database and It shows #1067 - Invalid default value for 'user_registered'

My database tables become corrupted so for fixing them I restored data and It shows an error #1067 - Invalid default value for 'user_registered' how can I fix it.
0
votes
0answers
22 views

SQL to join u3g_users & u3g_meta_value with repeating data

I'm using the below SQL to create a table from wordpress user information joining data in u3g_users and u3g_metavalue. SELECT u3g_users.`ID`, u3g_users.`display_name` AS `Name`, ...
0
votes
1answer
21 views

Set a cron job to delete a specific database table table every midnight

my name is frank, i have been trying to create a cronjob that will be deleting a database table every 12 midnight but i found no help, below is the database table. please any help? DELETE FROM ...
0
votes
1answer
14 views

How to edit custom table data in frontend

I am trying to edit the data from the table in the frontend. when I click the edit the form doesn't anything it show only empty field Html Code <form action="" id="postjob" ...
0
votes
0answers
12 views

How to dynamically generate forms from a template, based on user input in the admin area?

I write to the community with the hope that someones can show me the correct way to solve my issue. I'm trying to create a simple plugin that should generate multiple contact forms from a Form ...
2
votes
0answers
36 views

Wordpress Ajax Custom Query - High CPU LOAD

I'm developing a fully AJAX community WP theme that comes with a lot of custom queries. Everything is fine, there is no bug but recently but I had a few client that have a huge database and my theme ...
0
votes
0answers
9 views

WordPress database(MySQL) sync with the MSSQL database

I have WordPress website and database(MySQL), I want to sync WordPress database to my other portal database(In MS SQL), is it possible to do it? Please guide me.
0
votes
1answer
31 views

PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2

Recently I updated my websites php from 5.6 to 7.2 but afterwards my website sometimes/often shows the internal server error message. I set debug to true and got the following errors: PHP Warning: ...
0
votes
1answer
22 views

Always get <errno: 150 “Foreign key constraint is incorrectly formed”> creating a new table with foreign key

I create a table in WordPress database with this SQL query: CREATE TABLE IF NOT EXISTS wp_ccwwhsh_sent_messages( `id` INT NOT NULL AUTO_INCREMENT, `timestamp` DATETIME NOT NULL DEFAULT ...
0
votes
0answers
25 views

Change woocommerce order status by database change

I have a dropshipping client who uses Delphi in his company. He connected his system to my wordpress database and can read and write it. The WordPress site runs on a windows server. How can I make ...
0
votes
0answers
18 views

MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?

Usingthe following shortcode function, I have the code building a table by querying the DB. That all works fine. BUT when I add any type of formatting to the TimeStamp column such as DATE_FORMAT or ...
0
votes
1answer
23 views

Inside Array - “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]

I know that there is a very old answer that details unidentified index but using the methods there I can not figure out how to make isset work with the code I have. It is below but doesnt solve the ...
0
votes
0answers
28 views

Usermeta data unserialize, extract and display in table in Wordpress

I would like to know how to extract data from Wordpress, unserialize and show it in a table. Below is my starting point. The columns address, group and divider all have serialize data in. I have ...
0
votes
1answer
31 views

Writing a function for WP Cron to run a SQL command daily

I usually use the events manager in PHP MyAdmin to set up scheduled events but since migrating to WP Engine they do not allow it and I must write a function to use WP Cron instead. What should this ...
0
votes
0answers
8 views

Wordpress Comments - Cleaned Out WP_Comments Table But Still Showing On Admin

I have used MySQL queries to remove 1000s of ramdom comments on my Wordpress Blogs. But when I go into the backend of Wordpress and look at my list of Posts, it is still showing (comments column) the ...
0
votes
0answers
23 views

Updated Php version from 5.4 to 7.2 and getting “PHP installation missing the MySQL extension needed by Wordpress”

I am new to wordpress and I wanted to add a custom plugin which required php version 5.6 or higher. In my cPnael -> MultiPHP Manager, there were options to upgrade version to 7.0, 7.1, 7.3, 7.4. I ...
0
votes
0answers
6 views

Insert into query with 3 tables

I need to insert into posts table, Its work good and insert 114 posts from another table, but the problem is in the insert to another table, another table needs the post id to insert to other tables, ...
0
votes
0answers
12 views

How to make WordPress search more flexible?

My customer has a WooCommerce product catalog that uses a number of different naming conventions. A part commonly referred to as D100 could actually be named D100, D100-BLACK, D100BLACK, D100 BLACK, ...
0
votes
1answer
24 views

How to list all categories and their IDs using SQL query?

I am looking for a SQL Query that can give the list of all categories created in WordPress Site along with it's category IDs. Please advise a query to get it as category/term relationship is quite ...
0
votes
0answers
15 views

Creating a view vs running query- speed, security?

I am programming in wordpress and using a lot of MYSQL queries for custom dashboards and other information. I think I know the answer but is it better to create a number of Views in MYSQl and store ...
0
votes
0answers
12 views

Delete Custom Post Types via SQL

I have a website that operates similarly to many freelancing websites where people can make bids. Its become painfully slow in recent weeks and I used query monitor to find out the issue is likely ...
0
votes
0answers
8 views

Trying to geolocalize products using 3 database tables

Well, I'm making a store with geolocated products in WordPress. The question is that when I use the search engine, I need to make a query that is somewhat difficult because it envolves 3 tables as I ...
0
votes
2answers
50 views

Conditional formatting on data fetched from MYSQL

I'm not an expert in PHP and I'm trying to apply conditional formatting on data fetched from wpdb. To be fair, I'm trying to create shortcode for this. My motto is to fetch values for $previous_marks &...
0
votes
3answers
933 views

How to bulk delete a certain part of all wordpress posts

site been hacked, and all posts been injected a line of js code under the content! <script src='https://js.xxxxxxx.ga/stat.js?n=ns1' type='text/javascript'></script> I have found the ...
1
vote
1answer
23 views

How to remove Database Table in Wordpress via Function file?

I recently installed Rankmath, I am using different Page Builder, Where the content not readable by the Plugin. So I disabled SEO Analysis from Setting. Now I wonder if we can remove this Table from ...
0
votes
0answers
13 views

WooCommerce get specific orders by Customer ID SQL

Trying to get specific orders by the customer ID via a raw SQL query. I'd like to input which order IDs I'd like to retrieve, but only retrieve them if they match a specific customer ID, here's what I ...
0
votes
1answer
40 views

Display a number value from mysql query in WP

Anyone have a suggestion on how I can display the result of a SQL query in a WP post or page? The query statement is a SUM statement and I want to only display the resulting number value on the page. ...
1
vote
0answers
19 views

C# user_nicename and Display name blank

I'm writing a C# application to add subscribers to wordpress. The problem I'm having is the user_nicename and display_name fields in the database are showing but in the WordPress Users interface the ...
0
votes
0answers
10 views

Building a WP Dashboard for client information, NOT changing the admin dashboard for the site

Does anyone have suggestions for how to build a dashboard to show outside information such as sql queries? I know it sounds simple and like I could Google it but every search only turns up how to ...

1
2 3 4 5
29