Questions tagged [mysql]

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

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

SQL: trying to update posts that have certain custom meta

struggling with an SQL command.. I want to change a post type from 'post' to '2month' that have custom meta (low_jobs = 'under 100') and do not have certain categories UPDATE wp_posts.ID SET ...
0
votes
0answers
14 views

Error after saving german umlaut characters

I am trying to save a simple Html form to MySQL database which is in utf8 charset and the table is in utf8mb4_unicode_ci collation. I can insert new rows correctly and then update them from Wordpress ...
0
votes
1answer
30 views

What is the correct way to search 3 custom fields only in WordPress?

I have three custom fields (not using ACF). I want the search form to search for a match in: _cth_featured_zip_code_1 _cth_featured_zip_code_2 _cth_featured_zip_code_3 This is the query I've ...
0
votes
0answers
15 views

Moving a few select DB tables to a new WP instance

I’m currently in the process of building a new WP site for a client. The backend is going to be the same it’s just a front end update. Unfortunately due to certain factors we have have to build the ...
0
votes
2answers
43 views

Error establishing a database connection,

I'm getting Error establishing a database connection when installing WP. The following prints "Connected" when putting into wp-config.php: $mysqli_connection = mysqli_connect( $_dbsettings['host'],...
0
votes
0answers
46 views

How to merge 2 accounts with same email address after merge of 2 woocommerce databases

I need to merge Woocommerce customers accounts with same emails for each one. I've merged two Woocommerce databases - there are few customers on each of them. My question is how to merge with ...
0
votes
1answer
47 views

Get 2 meta values from meta key column

I want to select 'name', 'SKU' and 'price' from 2 WP tables: wp_posts and wp_postmeta. I don't know how to get data from 'meta_value' column twice for 'meta_key'='_price' and 'meta_key'='_sku' , ex. ...
0
votes
0answers
54 views

WP_Query adds “(wp_posts.ID = '0')” so no results are returned

I am doing a very simple WP_Query: $query = new WP_Query([ 'pagename' => 'some-post-slug', 'suppress_filters' => true // used by WPML to search in ANY language ]); However, the ...
0
votes
1answer
104 views

Wordpress how do I echo SUM from a column of a MySQL table by user id AND type_operation

I have account funds table in wordpress database. Structure like this; Id user_id fund_user type_operation ----------------------------------------------------------- 1 ...
-1
votes
1answer
130 views

Modify query with complex order

I create 2 custom database tables and 1 custom post type. After post creation i fill custom databases with data. This relation holds shop data. wp_post hold main data (mainly title) and connect with ...
-2
votes
1answer
51 views

WP_Query with LIKE returns strange query

IN works quite fine for comparison though array( 'key' => 'customdata', 'value' => $arraydata, 'compare' => 'IN' ...
0
votes
1answer
24 views

Using wpdb to connect to a different database is not working

I am attempting to use wordpress built in database functionality to connect to a different database on local host. I am doing this in functions.php. I have no problem achieving this with mysqli, the ...
0
votes
0answers
206 views

Update WooCommerce stock status with SQL query if stock value is greater than 0

I'm attempting to update a large product catalogue using a SQL query via phpMyAdmin if: the _stock_status = onbackorder the _stock > 0 Queries attempted: Update wp_postmeta Set meta_value = '...
0
votes
1answer
66 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
91 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
33 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
21 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
22 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
28 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
22 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
15 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
47 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
2answers
40 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
23 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
26 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
9 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
31 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
56 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
15 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
18 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
256 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
16 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
24 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
26 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
82 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
27 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
30 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
22 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
140 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
311 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
30 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
21 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
45 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
79 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
55 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 ...

1
2
3 4 5
28