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

learn more… | top users | synonyms

2
votes
0answers
269 views

How to let a user choose an authors and save it to the database?

I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user ...
1
vote
0answers
21 views

MySql query to get posts with all meta and terms

I'm trying to figureout a way to get all fields from wp_post with all of their custom fields and categories in one mysql query. So in one row of the result I should have post fields with their custom ...
1
vote
0answers
22 views

Trouble Migrating all data blog from Wordpress.com to Wordpress.org

I'm transferring a WordPress.com blog to a new WordPress.org website but I'm having trouble transferring everything. I've gone through the usual WordPress tools - export XML file, import using the ...
1
vote
0answers
15 views

Enabling plugin failed because MySQL user has CREATE permissions

Has anyone else had this problem? I'm trying to enable SearchWP plugin (but i don't think this is that specific plugin problem, but maybe my settings?) but it gives me the following error: Please ...
1
vote
0answers
41 views

inserting a post from an extern php file but post content doesn't show on wp site

I'm doing a php file that insert post's on my wordpress site. I'm filling all the fields in wp_posts, but the content doesn't shows on my wordpress site. I wonder if it's because the categories are ...
1
vote
0answers
49 views

Proper usage of $wpdb->update()?

I am trying to update my custom table in Wordpress using the following php code but still no success: $tablename = "wpfeedback"; $data = array( 'mark' => $mark, 'comment' => ...
1
vote
0answers
44 views

Manually query posts by taxonomy with MySQL

I'm trying to query posts from the WP database with the category uncategorised, while also joining the post meta table, but I can't get it to work. I get an empty result. This is my query SELECT * ...
1
vote
0answers
20 views

Regarding “Insert query error” in wordpress

I am getting "Insert query error" in my WordPress eCommerce website when I click on the place order button. My error is: Insert query error - Table 'i1503672_wp6.wp_wa_product_orders' doesn't ...
1
vote
0answers
27 views

How to add a private user page populated from sql?

I have taken over management of a Boy Scout website for around 75 kids. The site is a vanilla WordPress site and has no access control (other than admin). I would like a scout/parent to be able to ...
1
vote
0answers
174 views

Slow SQL_CALC_FOUND_ROWS Query

We are experiencing very slow performance with queries that use SQL_CALC_FOUND_ROWS within the admin section of WordPress. We currently have about 125,000 posts on our site and use Varnish to cache ...
1
vote
0answers
253 views

Wordpress Deadlock Error

I see more of this error these days in error_log. I see that someone asked this question here a year ago but no solution. Please advise what is causing this issue. Already, tried deactivating some ...
1
vote
0answers
100 views

mysql_real_escape_string() vs. esc_sql() in WordPress

Does mysql_real_escape_string() and esc_sql() in WordPress both do the same thing? I tried the following: $fetch_row='<p>And again for single posts</p>' echo mysql_real_escape_string( ...
1
vote
0answers
3k views

How to use update and delete query in wordpress

First i write manually update, delete, insert and select query and execute data with mysql_query function Like this: Select query $prefix = $wpdb->prefix; $postSql = "SELECT DISTINCT post_id ...
1
vote
0answers
158 views

Set Display Name to first and last name (phpmyadmin SQL Query)

I'm trying to change all the users Display Names to be their first and last name. I have looked into a number of plugins and wrote my own PHP to try and accomplish this however the site has over ...
1
vote
0answers
240 views

wpdb custom tables without plugin

I am using custom tables, with $wpdb, trying to perform basic queries at the moment. I can't find anything on manually creating tables then using them with $wpdb, everything is plugin related. I ...
1
vote
0answers
152 views

Slow wp-admin due to “SELECT DISTINCT post_mime_type FROM wp_posts WHERE post_type = 'attachment'”

The media library on a large site is slow in wp-admin. I did some research by looking into slow queries in the sql and found that this query is causing the slow response: SELECT DISTINCT ...
1
vote
0answers
27 views

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog. So I need your help to find the smartest solution to do it, ...
1
vote
0answers
393 views

Slow meta_query with about 4 milion record on wp_postmeta

Although optimized wordpress all the way but still very slow as follows : I have converted from LONGTEXT meta_value field to TEXT Then create INDEX for this field ALTER TABLE wp_postmeta ADD INDEX ...
1
vote
0answers
115 views

Calculate average crossing post categories

In my WP database I have some posts i the category hotels and some other posts in the category visits. In the posts (placed in the category visits) there is two meta_fields ( rating and placeid ) ...
1
vote
0answers
283 views

Renaming admin user on multisite install by MySQL

As part of a general tightening of security, I want to change the name of the admin user on my multisite install to something less commonly used. This user is admin on all five sites in the network ...
1
vote
0answers
405 views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
1
vote
0answers
761 views

$wpdb->insert() does not Insert record in a table

I'm trying to understand and get hold of the $wpdb global object but can't seem to make it work. Basically, I'm trying to insert a single record into a custom table in wordpress DB. Instead of ...
1
vote
0answers
354 views

Wordpress running SQL query to update database from form

Basically I want to take information in from a form and use a separate php page to update the database. so here is the original wordpress php page (add_person.php): <?php /* Template Name: ...
1
vote
0answers
401 views

Cleaning up bloated wp_postmeta table by removing multiple _thumbnail_id's?

On a very old site (7 yrs) with a lot of posts (30k) I've been trying to whittle down the database tables. The postmeta table is 1.5m rows, 750k of those rows are for a meta_key named ...
1
vote
0answers
3k views

How to fix database error duplicate entry

At first I thought this was just a damaged table, so I tried repairing via MySQL, but it appears there's more fundamental issues. Which of the duplicates should I remove, and any further advice in ...
1
vote
0answers
132 views

WordPress plugin overloading with tmp tables

I have asked at the plugin's (WordPress Popular Posts) support a few days ago, since no response hope to get some insight or help here. Thanks. Hesitant to tweak settings like max_heap_table_size ...
1
vote
0answers
354 views

WordPress Query wp-terms SLOW

I've got a very large database in WordPress with lots of products in WooCommerce along with quite a bit of taxonomies. When querying the products on the front end it takes 1 minute or more. Here is ...
1
vote
0answers
89 views

Regex to turn embedded images in to attachments

I've got a blog that has all images embedded in each post rather than a thumbnail linking to an attachment page which is what I'd like. I understand from this question that no plugin (like Regenerate ...
1
vote
0answers
225 views

Query most popular terms by taxonomy over 2 week period

I have written SQL for a query that pulls the most used taxonomy terms for selected taxonomies that are published, do not have a parent post are not in a comma separated list over the past two weeks ...
1
vote
0answers
309 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
1
vote
0answers
69 views

How can I make wordpress suppress mysql errors?

Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb? From what I've read setting WP_DEBUG ...
0
votes
0answers
21 views

How to translate this mySQL query to $wpdb query

I'm having trouble recreating a query from straight mySQL to $wpdb compatible. SELECT meta_value FROM `wp_postmeta` WHERE meta_key = 'review_rating' AND meta_value = 5 AND post_id IN ...
0
votes
0answers
18 views

Import SQL backup

So I accidentally deleted MySQL database of my wordpress, but my site is still running, I can access all the file in the filezilla but I just can't access the admin area of wordpress to make any ...
0
votes
0answers
51 views

Cannot login into non-profit website anymore

To preface, I have read the Wordpress Codex "Login Trouble" page and tried everything there. Due to the website being a non-profit and helping animals its a big problem. Basically I had an issue a ...
0
votes
0answers
17 views

Bulk find replace to convert hundreds of old URL calls

We have a new wordpress site generated from an old html site with thousands of pages. An import process was used, but unfortunately as a result the site has hundreds of references within content to ...
0
votes
0answers
31 views

How send simple push notification from php in android

I want to send android push notification from php. I have created admin in php & mysql when admin approve anything from admin than send notification to user.
0
votes
0answers
30 views

How to install wordpress on university server?

Recently my supervisor asked me to install wordpress on the server. Indeed, I have no access to root. I just have a ssh access to the server and the operating system on the server is Linux. What steps ...
0
votes
0answers
43 views

How Can I lock function to prevent running multiple instances in one time?

I have written a plugin. There's a function int it that works with a DB table and (works on a data tree) ,I want if function starts running ,other instances lock until it finishes(then other instance ...
0
votes
0answers
28 views

update_user_meta and wp_update_user not working

I have an array of users that I've successfully updated as described here foreach ($users_out as $key_u => $value_u) { $user_id = $value_u['writer_id']; $user_login = $value_u['username']; ...
0
votes
0answers
37 views

Getting invalid user ID error when creating a new user with wp_insert_user

I'm trying to insert users into wordpress from a foreign database and I've prepared my $userdata as foreach ($users_out as $key_u => $value_u) { $user_id = $value_u['writer_id']; ...
0
votes
0answers
21 views

Find page metadata in database

I want to insert metadata to custom fields (from "advanced custom fields" plugin) manually (with wp_update_post_meta). I need to know how the meta value strings look like so I can insert this kind ...
0
votes
0answers
14 views

Editing a Wordpress SQL table in Phpmyadmin, however its not saving

I'm trying to edit the wp_options table in Phpmyadmin, I can edit it fine using inline editing or the edit feature. Each time I log into phpmyadmin I can see the value has changed to the one I edited. ...
0
votes
0answers
37 views

I want to query for the 'post' and 'attachment' in wordpress using SQL query

How do I write a SQL query which will allow me to query for the 'post' and 'attachment' at the same time in MySQL? I am trying to get this information from the wordpress 'Posts' table. Please see my ...
0
votes
0answers
284 views

Insert data into mysql database with php and ajax

I made admin menu inside wordpress and I have form that allows admin to insert some values. I have html: <form id="prices_form" method="post" action=""> <div ...
0
votes
0answers
40 views

Remove Special Characters from Wordpress Media File Names in HTML

I've removed all the special characters from media filenames in the database (meta_key - _wp_attached_file - filename), I've renamed the files in the FTP and rebuilt the thumbnails a few times. ...
0
votes
0answers
19 views

Error establishing a database connection But all is same

I was upload my web file and MySQL base to CPANEL. Database name, user and password is all SAME in my config.php file. BUT i cant connect my web. /** The name of the database for WordPress */ ...
0
votes
0answers
25 views

Display data form externally table as posts?

I have an external MySQL table with roughly 4,000 rows and would like to display each row as a post within my Wordpress blog. The table grows almost daily so ideally I would like users to be able to ...
0
votes
0answers
22 views

Add/edit row/rows in tables

I've done some tables in my wordpress-database: area, producer and product where one area contains many producers and where the producer contains many products. How to do a menuoption in the Admin ...
0
votes
0answers
32 views

Export User Info into CSV - Additional Column (post_title)

I'm using the 'Export Users to CSV' a plugin for wordpress. By default, The plugin only extracts wp_users and wp_usermeta I have been wanting to add post_title column from wp_posts. I was able to ...
0
votes
0answers
17 views

Ordering topics by most replies in X days using MYSQL statement

I'm using the following MySQL statement to grab the topics (BBpress custom post type) that have the most replies (custom post type like comments) in the last X days. However I've found that I get ...