Questions tagged [mysql]

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

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

HA WordPress implementation question

I am looking forward to eliminate SPOF in my PHP/Nginx/MariaDB/Redis WordPress website. For this purpose, I am about to move from a single server to a more complex HA scenario that as far as I ...
0
votes
0answers
24 views

Issue developing an AJAX form with Wordpress

I am trying to develop a custom form working with AJAX. But there is no way to work because everytime it gives me the below message: "POST http://wellness4yourself-com.stackstaging.com/wp-admin/...
0
votes
1answer
31 views

update_option returns false in AJAX, how to debug?

I tried debug plugins for WordPress, but they only show the current page SQL queries. How to debug if update_option returns false? I am updating an object decoded from AJAX request with json_decode ...
0
votes
0answers
14 views

Issue Converting Get_Results to Prepare to add a variable

Afternoon all. I'm trying to convert the following get_results query to allow the use of a variable dependent on which page link will be clicked for a team roster page. I currently have 3 different ...
0
votes
2answers
30 views

WP + MySql db / PHP

I have a website running WP connected to a MySql db, where the latter uses PHP. I did not make the site and have only small experience with WP. This may be a simple question. The WP also uses ...
0
votes
1answer
23 views

Why can't i come back to older working version of php after ugrade with error log on php 7.2 and 7.3

I'm getting locked out of */wp-admin/ there is an error log. Its after changing php 7.2 to php 7.3. The error doesn't disappear even if i go back to php 5.6 where MySQL_connect function exists and is ...
-2
votes
1answer
53 views

why you don't Implement PDO for access every thing to database

that is.. why wordpress don´t use PDO if it is more secure, and prevent a lot of injections, and issues with security. Thakns
1
vote
0answers
44 views

how to solve slow WordPress site caused by attachment_metadata

My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as: improved my DB, used cache plugins (WP Rocket and W3 Total Cache) which both ...
0
votes
1answer
398 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 ...
0
votes
1answer
106 views

Ajax $wpdb not returning table data

I'm using WordPress 5.0.2 with WooCommerce 3.5.3 and I have two selects dropdown field on the checkoutpage. I want to retrieve the selected region_code value from the billing_region dropdown and then ...
0
votes
1answer
37 views

Update MySQL query so that it functions again

I've inherited an old WordPress site that my customer doesn't want to be rebuilt. It has an old MySQL query in the functions.php of the theme that is supposed to put a category image with the ...
2
votes
2answers
129 views

How to create 450 categories in wp

I am having trouble to find a way for how to add categories for all the products. I have Apple, Samsung, Sony, Xiaomi, Huawei categories and each of there needs subcategories which will stand for ...
2
votes
0answers
31 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 ...
0
votes
0answers
34 views

Php find date in meta_value between 2 date ranges

I want to search SQL database using PHP and look for meta_value. The meta_value contains data like this: "FixtureMatch_Id":"391270","Bookmaker":"1Bet","UpdatedDate":"2018-12-14T12:48:57.64"" So ...
1
vote
1answer
262 views

Changing user_nicename

user_nicename has the same value with user_login. I want to change user_nicename value only by using code snippet into functions.php or wp-config.php. Is it possible without using phpmyadmin or any ...
0
votes
1answer
24 views

Sql Update CPT from publish to draft and particular custom field

I have: CPT: match custom field: played Is it possible by MySql to change the status from publish to draft of all posts of CPT 'match' with custom field set as '0'? A good start can be UPDATE ...
-1
votes
1answer
28 views

Add a navigation menu item using MySQL

I want to insert Wordpress nav menu items into MySQL using PHP. I dont think i can use wp_create_nav_menu() because I need to build a preliminary menu from the categories (over 100 cats!) then a ...
0
votes
1answer
567 views

how to encyrpt DB_PASSWORD in wp-config

Recently moved my wordpress site to another hosting provider and after importing my database I had issues establishing a database connection. I edited wp-config file and entered my DB_PASSWORD to re-...
0
votes
2answers
128 views

$wpdb->prepare with LIKE and sprintf

Ok, I know similar questions have been asked before but none of the answers I found seem to work. Here's my code: $sql = $wpdb->prepare('SELECT ID FROM ' . $ignore_url_table_name . " where url ...
1
vote
1answer
393 views

How to handle 400 status in Ajax [duplicate]

I have created a page in wordpress which is hosted in localhost. The page containing two drop down lists. one is for selecting category lists from a table called 'category' and the second drop down ...
0
votes
2answers
106 views

AJAX Implementation

Am try to implement data from database using AJAX based on a drop down list in WordPress. The codes returning 400 bad request in the console. I am hosted the page as localhost. Here is my theme's ...
0
votes
2answers
26 views

How to configure Wordpress Database for CentOS 7

I'm trying move an existing Wordpress site to run across two different servers, one with Apache and the main source code and the other that just has the database running on MYSQL. wp-config: define('...
0
votes
1answer
383 views

WordPress database error Duplicate entry for key 'slug'

I have just migrated to a new host and upgraded my Wordpress to 4.9.8 (from 3.9.x, embarrassing I know, plan to keep it up to date from now on). I also went through the process of replacing plugins ...
0
votes
1answer
234 views

How to set MYSQLI_OPT_INT_AND_FLOAT_NATIVE option

I'm having troubles with the mysqli driver used by wordpress, where it is converting each and every integer value to a string within $wpdb->get_results("SELECT..."). I know that it is possible so ...
0
votes
2answers
82 views

Case insensitive ORDERBY in wpquery

I'm trying to sort custom posts in alphabetical order, and I've just now realized that capital letters are being sorted before lowercase. Two restaurants start with 'Cal' and 'CAT' with 'CAT' being ...
0
votes
1answer
43 views

Search returns “Nothing Found” on a sub directory

I've created a multisite using subdirectories. The search function, both in backend and frontend, only works on the main site. If I try and do a search in a subdirectory it returns with "Nothing Found"...
0
votes
1answer
131 views

Delete posts with word count less than x number of words

I searched a lot about this, found plugins that are out dated and consumes massive resources and finally do nothing, is there like an SQL line to delete all posts that have a word count like less than ...
1
vote
0answers
22 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 ...
0
votes
1answer
84 views

The plugin generated 225 characters of unexpected output during activation

I am getting the famous "The plugin generated xxx characters of unexpected output during activation." error when I activate plugin I am working on. Terminal says my files are in us-ascii, but when I ...
0
votes
1answer
184 views

Update a user meta key based on WooCommerce product purchase

I have a WooCommerce shop. I have a custom user meta key for user expiration that I need to update based on the result of all users who have purchased a specific product. Unfortunately, I have not ...
0
votes
0answers
246 views

Get menu items in MySql Wordpress database via sql query

There is menu 'menu-name' on wordpress site. On wordpress I can get menu by $menu_items = wp_get_nav_menu_items( 'my-menu' ). Then in foreach loop I get url for menu item: $url = $menu_item -> url. ...
0
votes
0answers
21 views

AJAX request returns back Array0 to console

I'm making an AJAX request in wordpress for the first time and I'm trying to access my custom made table to retrieve single name (string) or multiple names. It all works without the errors, except for ...
0
votes
0answers
11 views

sql query for selecting btween two amounts

I am trying to achieve the result by selecting dropdown between two amount range. echo '<option value="browse-events?city='.$browse_city.'&type='.$browse_type.'&price=Free">Free</...
2
votes
0answers
165 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 ...
1
vote
1answer
544 views

How to get data from WordPress site sql file

I have an SQL file of my WordPress site but I lost my project files. So if I import the sql into my DB then can I run the sql with new database file? Or is there any other way to back the previous ...
0
votes
1answer
33 views

Unexpected behavior when trying to manually install Wordpress on macOS Sierra

Server Configuration macOS Sierra 10.12.6 Server App v5.3.1 (Websites Service is ON and serving other sites) mySQL v8.0.12 (Verified up and running) PHP v7.2.10 (Verified through phpinfo()) Wordpress ...
0
votes
1answer
43 views

DB Query not working in Plugin

I am working on a plugin. And I want to create a table via the plugin. So I am trying execute following SQL Query. global $wpdb; $createSQL = " CREATE TABLE `". $wpdb->prefix ."...
0
votes
0answers
20 views

How to map data on CSV to web pages?

Like Contact information, descriptions, budget, prices, other numbers, on a CSV or spreadsheet, how to link it to WordPress web page? I'm using cpanel, WordPress, Tablepress plugin, elementor page ...
0
votes
1answer
667 views

How to unserialize data from MySQL

I'm trying to unserialize data from WP's MySQL table. It looks like this my function from template-page.php <?php function get_values(){ global $wpdb; $parsed = $wpdb->...
0
votes
0answers
16 views

Multisite: search all blogs by custom taxonomy

With multisite, each blog has its own table. I want to create a plugin that will add custom taxonomies to all blogs. I know how to do this. Then I want to create a query to return all posts for a ...
0
votes
2answers
48 views

Wordpress post insertion from PHP file

I have a website it's contains a lot of news, i have to list this news in one PHP file , now i want to insert each news in wordPress as a Post.. what is the best practice way to do that (the news are ...
0
votes
1answer
37 views

Proper way to display latest 5 posts grouped by post type?

i need to display the latest 5 posts of each post type, something like: Latest BMW Posts: Post title BMW 1 Post title BMW 2 Latest Audi Posts: Post title Audi 1 Post title Audi 2 And so on. It ...
0
votes
1answer
23 views

Add postmeta to all blog posts

I have a bunch of blog posts that I need to update with a custom postmeta key/value pair. Therefore I have two questions - where can I find the postmeta entries in a worpdress MySQL database and how ...
1
vote
1answer
256 views

Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]

I've been using Local by Flywheel for my local dev environment but recently it started acting weird so I decided, that since I'd finally learned a decent amount of CLI, maybe I should try just using ...
0
votes
1answer
19 views

Show Mysql table elements as pages in Wordpress

I am trying to build a WordPress site, but I need a specific functionality and I haven't been able to find a plugin for it. I'm going to be scraping sites info and posting the info into a DB (this is ...
0
votes
1answer
323 views

How to properly check if a table exists in WordPress Database using Show Tables Query

This query when runs always create logs for Database error. It works fine when table exists, but when it does not it generates the below shown debug logs. Any alternative way to check if database ...
0
votes
0answers
236 views

Ajax duplicate multiple inline data checking from database

I am trying to make a form with multiple same type field (i.e. title) in Wordpress. In that case I need to ensure that no duplicate data is being attempted to insert before the form is submitted. I ...
2
votes
0answers
108 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 ...
0
votes
1answer
20 views

How To Upload Existing WordPress Site To WordPress Multisite Using SSH

I have a WordPress site that needs to move into a WordPress Multisite. I tried to find the site file to upload in wp-content/uploads/sites but I couldn't locate the file. I also tried to upload the ...
0
votes
0answers
82 views

Create WordPress shortcode from database entries

So I want to create a shortcode for every row in my database. The problem here is that the add_shortcode() requires a shortcode, which I can create a variable for in a foreach loop and a callback ...