Questions tagged [mysql]

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

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

Custom post type and custom taxonomy key lenght & query performance

I'm creating new custom post types and taxonomies for my client and I wanted to prefix their keys so there is no conflict with any plugin that could be installed that would be providing it's own CPT ...
0
votes
1answer
66 views

I am facing this error Your PHP installation appears to be missing the MySQL extension which is required by WordPress

my website is fine till yeaterday. Today when i open my website url saw this error. Your PHP installation appears to be missing the MySQL extension which is required by WordPress. Even i am unable to ...
0
votes
0answers
26 views

wp-cli import throws ERROR 1045 (28000) password error after changing DB password; wordpress and mysql work with new password

I'm Running Wordpress on a Bitnami VM. I updated the database user's password for my wordpress site. Everything except wp-cli works fine with that new password. Relevant part of wp-config.php looks ...
0
votes
0answers
67 views

Escape special characters in string

I am using mysql. I would like to insert a string in to a table which possibly contains some characters which would cause query to fail (characters like single quote ' then pipe | maybe some others..) ...
0
votes
0answers
14 views

Wordpress Bad Request Error 400

Can someone get me out of this trouble? I have successfuly tested wordpress on xampp and works fine, however, on a dedicated I 'm getting an error 400 Bad request until I manually remove any .php ...
3
votes
1answer
163 views

Does using set_transient() function can lead to MySQL problems?

As a plugin author, I have to think about many things. One of my plugins uses a temporarily PHP session to save the JSON data that receives through its API in array type. Because PHP session has its ...
1
vote
1answer
25 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?
0
votes
1answer
65 views

SQL: How to find all attachments that are not used in any posts/pages/custom_post_types

I have a wordpress installation where the posts also contain attachments that were not embedded in the content by using the media library -> add. I would like to find all attachments that are not ...
0
votes
0answers
17 views

SQL Joins not getting correct columns

I'm trying to alter the main query via posts_where & posts_join, in order to select the following: Orders (post-type) that have meta_key='_customer_user' that is >= 1 (can do this via standard ...
0
votes
1answer
27 views

How can I find user role in Mysql?

SELECT user_id FROM $wpdb->usermeta WHERE meta_key= .$wpdb->prefix. _capabilities AND meta_value= ROLE in serialized array. How can I set meta_value in serialized array? Many thanks in advance ...
0
votes
1answer
38 views

How to display MySQL table data which is stored as an array?

I have the table "mlw_results" which stores results of quizzes on my WordPress website. I use "Quiz And Survey Master" plugin to create these quizzes. Now I need to display all the results of a ...
0
votes
0answers
42 views

Wordpress UPDATE queries on MySQL database stuck

I have an Amazon 24XL server 96 Cores 378 GB RAM Database size 5.7G Debian GNU/Linux 9 (stretch) PHP 7.3.16 mysql Ver 15.1 Distrib 10.3.22-MariaDB I have only one WordPress site where users read ...
0
votes
0answers
20 views

Store GA Client ID in User DB

How can I retrieve Google Analytics Client ID from HTTP headers and store in a custom field in the User database table?
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
3answers
2k views

How to execute mulitple statement SQL queries using $wpdb->query?

I call $wpdb->query() on a query like INSERT INTO wp_ctt_timetables (name, homework, tod, class, dow, lesson) VALUES ('', '', '', 3, 0, 0); INSERT INTO wp_ctt_timetables (name, homework, tod, ...
1
vote
0answers
10 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 ...
0
votes
1answer
45 views

Store GravityForm data in phpmyadmin (mysql)

I'm currently developing a small portal on Wordpress for a client where users have to submit forms (created with Gravity Forms). I'd like to be able to store the data from these forms, upon submission,...
1
vote
1answer
20 views

Better ads plugin has 500.000 entries in wp_postmeta

My wp_postmeta table is huge, around 1.2 million entries, about half of those are caused by bs entries (_bs_via_rel_2, _bs_review_verdict, _bs_source_url_2, _bs_source_url_3... etc). From what little ...
0
votes
1answer
14 views

Find locations of all featured images of draft posts via SQL

I'm trying to get the file locations of all featured images used in draft type posts via SQL and phpmyadmin. posts type attachment should hold the location of the image in the guid column. SELECT ...
13
votes
10answers
27k views

How to replace the domain name in a Wordpress database?

I have a Wordpress database which was installed in a development environment... thus, all references to the site itself have a fixed IP address (say 192.168.16.2). Now, I have to migrate that database ...
1
vote
2answers
2k views

Modern Tribe Calendar wp-query with meta query not working at all

I've been searching for a good few days now trying to get my WordPress event calendar by modern tribe working as I need it to. I have hundreds of order by and delivery dates in DB each one separated ...
0
votes
1answer
18 views

Same request Mysql/Php not same result

I have this PHP query: $querystrShop = $wpdb->get_results(" SELECT productid AS post_id,( 3959 * acos(cos(radians($latitude)) * cos( radians(...
0
votes
0answers
25 views

Insert and retreive data from custom database from Wordpress page

This is the first question I'm asking here, so I'm open to any feedback on how to clarify my problem/question! I have created a small javascript game on a wordpress page with "custom html". I'd like ...
0
votes
0answers
8 views

My WordPress website loads with all content highlighted

everyone. I'm having an issue that randomly started recently where all content is being highlighted when the page loads. This is actually the first time I've come across such an issue. Has anyone ...
0
votes
1answer
487 views

Copy wp_postmeta from one database to another

I had a site setup on old-domain.com, which used the database old_db. Recently, we had to migrate our website to a new server and domain, new-domain.com which uses the database new_db. I installed a ...
0
votes
0answers
28 views

Got 404 error when changed siteurl via DB in Wordpress

The problem is that I have changed the wp_options table with site URL and home fields from http://localhost/WordPress to http://localhost/test I get 404 errors or Object not found error. What I ...
0
votes
1answer
34 views

SQL syntax error. However, it works normally at phpmyadmin

I have this error : [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4] SELECT COUNT(*) FROM ...
0
votes
1answer
22 views

Get decimal from product price with Mysql

I try to get min product price like this: $pts = $wpdb->get_results("SELECT post_title, ID, MIN( CAST(wm.meta_value AS UNSIGNED)) AS price FROM phiz_posts INNER JOIN phiz_postmeta wm ON (...
3
votes
3answers
2k views

My WordPress site always displays a cached version of its homepage

First of all, sorry if I'm making a mistake. I already asked this on the ServerFault forum, but got no answers at the moment and I thought it would be a good idea to ask the question here, considering ...
1
vote
2answers
268 views

Weird 404 URL Problem - domain name being placed at end of urls

For some reason when doing crawl tests I'm finding pages with the domain name being tacked on the end and causing 404 errors. For example: http://domainname.com/page-name/http://domainname.com This ...
0
votes
1answer
53 views

Is deleting orphaned wp_options entries safe?

I have a wordpress site with some serious wp_options table bloating. This is causing slow page loads and memory bloat. After investigation, there appears to be thousands of orphaned entries. Is the ...
0
votes
0answers
27 views

Limit total number of post and post per page with get_results

I'm using a custom table with a additional column, so I can't use regular wp_query. My code is working great except for the total number of post. I want to display 5 results per page (which works ...
0
votes
0answers
24 views

Recounting all posts' comments

I moved back from Disqus to WordPress' built-in comment system. Unfortunately many of my posts display the wrong number of comments (many say 0 comments but that's wrong). This code works for PHP up ...
1
vote
3answers
11k views

How to force update all posts after import

I recently imported large number of custom posts into wordpress. all works fine, except one taxonomy which is imported, but not show at the front end, until i click on every post "update" button. I ...
0
votes
2answers
45 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
0answers
20 views

Relating wp_user, wp_usermeta, and a custom database table

I am working on a site for a non-profit that has collected data on their 'Members' (over 2,000 members). Members report their surgeries and experiences in order for the non-profit to collect data on ...
0
votes
0answers
48 views

Display total sales and total order placed depends on specific category

I have this function which shows total number of orders (ie. 2) and total sales (ie. $200). What I want to get is only numbers relating to specific category (not the total numbers) function ...
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
19 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 ...
1
vote
1answer
2k views

Can't get wp_insert_post to work

I'm trying to code a loop that will post articles from a SQL database. However, whenever I try to load the page I get a 500 error and nothing is showing up in the error logs. Code: <?php define('...
0
votes
1answer
33 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
45 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'],...
2
votes
5answers
4k views

Error establishing a database connection - with Debug Data

my site started acting up a few days ago, running the debug I get these lines. Tried to mess around with the DB but couldn't get my head through it. Do you have any idea what those lines imply? ...
1
vote
1answer
579 views

Deprecated: mysql_connect():

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/gorilla911/public_html/wp-includes/wp-db.php on line 1520 ...
0
votes
0answers
96 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
0answers
83 views

Featured image from custom to Wordpress database

I want to adapt my old custom website database (composed of only one table) to Wordpress database. All data has been correctly imported in both tables (wp_posts and wp_postmeta) with a php code that ...
0
votes
1answer
83 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
1answer
100 views

How to write in MySQL more characters in user_nicename

I install the plugin on the site for registration in Russian(Allow Cyrillic Usernames) and now I need to change in the sql database, in the table wp_users, in the column user_nicename permission to ...
0
votes
0answers
72 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 ...

1 2 3
4
5
29