Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Update a list of product to featured if product have meta value (Mysql not wpquery)

Since woo 3 featured product is name and slug of taxonomy 'product_visibility'. I need to update all products with same meta_value contained in list to 'featured'. My products have a meta_key = '...
0
votes
0answers
21 views

Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?

I am experimenting with bulk import from csv file for my plugin. As I am new to plugin develpoment, please guide me if I am doing something wrong. What I have: I have 4 columns of multiple rows in a ...
0
votes
0answers
9 views

How to generate MySQL automatic Application id

I have web application using PHP and MYSQL. I have application form i want to generate automatic application form number which is count number of row inside Mysql then add value + 1
0
votes
0answers
29 views

How to add virtual column in wpdb get_result statement

i want to add a virtual column to wpdb get_results statementthis is my code and the column gid returns nothing . $result = $wpdb->get_results ( " SELECT helo AS gid, calendar_id, day FROM table1" )...
1
vote
0answers
19 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 : ...
0
votes
1answer
19 views

Custom array from a query only write the last row of the query

Looking for some input on this one. I am writing a custom array but having a strange issue. It seems to be cycling through the loop and dropping previous values and only storing the last row of the ...
0
votes
1answer
21 views

SQL query to change custom field in Wordpress database

I'm newbie in SQL questions, and today i have a big problem. I need change many fields in my SQL, about 4,5k. But have some rules to the query change, to don't change wrong fields where don't need ...
0
votes
0answers
11 views

Wp_termmeta may be corrupted? Change on database doesn't reflect on website

By updating a plugin (ACF Pro) while there were permission errors on the server, a strange thing happened that I can't explain to myself in any way. Specifically, the wp_termmeta table, in which, ...
1
vote
0answers
14 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 "...
0
votes
1answer
35 views

What is this? MySQL array?

In my phpMyAdmin, one meta term, have this value: {a:1:{i:0s:82:"http://parquedasfeiras.online/wp-content/uploads/2019/12/alefit-e1576791796664.jpg”}} What is this? MySQL array type?
0
votes
1answer
30 views

cant insert data in a custom table in phpmyadmin

i created a dbdelta table but i cant seem to insert any data here is my code please help function lapizzeria_save_reservation() { global $wpdb; if(isset($_POST['reservation']) && $_POST['...
0
votes
1answer
12 views

Bulk find & replace on Wordpress posts/pages (minus image paths)

I'm dealing with a tricky issue and wondering if anyone has a good way to solve this. I am trying to change everything on my Wordpress site that has "2019" in my posts/pages with "2020", however when ...
0
votes
1answer
21 views

dbDelta not CREATING TABLE

Here's my code. Please help function lapizzeria_database() { global $wpdb; global $lapizzeria_db_version; $lapizzeria_db_version = "1.0"; $table = $wpdb->prefix . 'reservation'; ...
0
votes
1answer
17 views

Regular XML-RPC timeouts

I am hoping to get some tips for troubleshooting this annoying timeout issue. Configuration: Windows 2012 R2 with IIS PHP 7.3 MySQL 5.7 Wordpress.org 5.3.2 WP is configured as network with 5 ...
0
votes
0answers
8 views

Get name of all term which is duplicate using Mysql

I am coding something to get all duplicate term which has duplicate name using MySql query. The issue I have currently is I am getting the records in a single occurrence I need all data which has same ...
0
votes
0answers
25 views

Wordpress cloning issue

I have cloned my wordpress website abc.com using duplicator plugin. The clone is successfully installed and working on my other domain abccopy.com. But abc.com/wp-login.php page has a background image ...
0
votes
0answers
22 views

How to import woocommerce custom fields data into another site?

I m trying to import this product custom field data into my another wordpress site but its not showing any option to me when i try to import it into my other site ?
1
vote
1answer
33 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`, `...
0
votes
1answer
13 views

How to edit content in WordPress and the Polylang – plugin? – with demosite

hello dear user, hello dear developer, the question; How to edit content in WordPress and the Polylang - plugin? first of all: i love PolyLang for its powerful features and the versatile options ...
1
vote
1answer
15 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

i have an error. Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in C:\xampp\htdocs\gudang\function.php [closed]

$conn = mysqli_connect("localhost", "root", "","gudang"); function query($query) { global $conn; $result = mysqli_query($conn, $query); $rows = []; while( $row = mysqli_fetch_assoc($...
1
vote
1answer
13 views

Bulk edit existing shortcode within custom field

I have a very similar question to this: Custom Fields Bulk Edit I would like to edit ALL of the data inside a custom field but instead of replacing values I would like to instead add an attribute to ...
1
vote
0answers
15 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
21 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] "; /* ...
0
votes
0answers
26 views

Wordpress database problem wp_posts, primary key

Repende my website in wordpress did not let me work properly, did not let me publish an article and showed me a problem in the editor show the message: "You are editing the page that shows your latest ...
1
vote
0answers
24 views

How do I run SQL queries on a WordPress web page? [closed]

Whenever I Google this it brings up pages related to Database management. However, I want to run this in the actual webpage. For example: You go to a webpage where you can practice SQL: I.e. you ...
2
votes
1answer
24 views

SQL User Query by Multiple Roles using PHP

I can successfully get all my WordPress users using the following code: global $wpdb; $sql = 'SELECT * FROM ' . $wpdb->users; $users = $wpdb->get_results( $sql, 'ARRAY_A' ); However, I need to ...
1
vote
0answers
20 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
69 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
votes
1answer
154 views

Stop all SQL_CALC_FOUND_ROWS wordpress queries

In phpmyadmin I often see this query that hangs with a status of "sending data": SELECT SQL_CALC_FOUND_ROWS wp2a_posts.ID FROM wp2a_posts WHERE 1=1 AND wp2a_posts.post_author IN (1) AND ...
0
votes
0answers
28 views

$wpdb->get_results returns different results compared to phpmyadmin

this is my sql statement, which works in phpmyadmin: SELECT wp_ccs_cashflowaccounttype.cashflowaccounttypeid, wp_ccs_cashflowbookingtexttype.cashflowbookingtexttypeid, w.invoiceid, ...
0
votes
1answer
19 views

Basic wpdb update question

I can't get this to work and I don't really know how to debug it. In the URL I'm getting this added: ?candidat=41&selectCandidate=selectCandidate global $wpdb; if(isset($_POST['...
2
votes
1answer
41 views

How to get the post_id from postmeta

I am trying to fetch the post_id from the wp_postmeta table, here is the code I'm using: if(isset($_POST['patientid'])) { //user enters the patientid $thevalue = $_POST['patientid']; $tbl = $...
0
votes
0answers
22 views

How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?

I'm not a novice web developer. I know how to use Python and Django at a beginner to intermediate level. I know my basic HTML5, CSS, and JS. I've been learning React.js through Scrimba.com as well as ...
0
votes
0answers
37 views

INNER JOIN custom tables - SQL Query

H, I am trying to get results from two tables with INNER JOIN in WordPress theme template file, but I don't know what's I am doing wrong. Please help me, here is the code below global $wpdb; $user_id ...
0
votes
1answer
35 views

MySQL error or data corruption after database migration

I migrated my database to a new host, as well as my WordPress files, I have an online shop using WooCommerce, and everything ran smoothly after migration, what I did not notice at first was that ...
0
votes
0answers
15 views

How to import products in host instead of database on wordpress?

Once I add new product in WordPress, this product adds in MySQL database and database gets bigger and bigger after months I would like to write post/page/products on the host instead of the database ...
0
votes
0answers
119 views

PHP Warning: mysqli_error(): Couldn't fetch mysqli in

I am new at this, so this is my case. I am getting this error on my Wordpress site and I need someone to point me out where to search the problem. I know that is written in a log file and here it is, ...
0
votes
1answer
19 views

WordPress Dutch characters encoding problem

I am using the Dutch special characters like ï and it is being converted to u00ef. I have tried ut8_unicode_ci in wp-config and in the database tables where the value is saved but it is still saved ...
0
votes
1answer
43 views

Replace a character in all post titles and slugs

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324. I'd like to replace m with p in all post titles and slugs, while keeping X and Y ...
0
votes
1answer
70 views

Update Custom Post Type Taxonomies with SQL

I'm trying to update post category but i keep error messages. I have built an update form. each category is a different product type (and a custom post). all the other fields are working except the ...
0
votes
0answers
129 views

WordPress php mysql errors - errcode: 13 permission denied

I'm developing a WordPress based website using the latest XAMPP release from Oct 9 2019 with Apache 2.4.41, MySQL/MariaDB 10.4.8 and php 7.3.10 using localhost on a Windows 10 machine. Since updating ...
0
votes
0answers
38 views

How can I match multiple CPTs in one row in mySQL?

I would like to start a query in the WordPress mySQL database where I connect several CPT's with each other and output them in one row per service CPT. mySQL example:http://sqlfiddle.com/#!9/2ed83c/3 ...
0
votes
1answer
52 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
45 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
35 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
23 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
71 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
31 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
103 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, ...