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

learn more… | top users | synonyms

0
votes
0answers
5 views

How to search for posts IN OR title OR content OR author?

I have looked at many posts and questions regarding searches for custom meta, but I want to search for posts and include those if the search query matches an author name. I have come up with the ...
0
votes
0answers
21 views

two wordpress sites, two themes, one database, same content

I am doing research about wordpress and there are many interesting stuff to learn, i browse the wordpress forum and i found a post about duplicating site.. or multisite.. I am not sure exactly how it ...
1
vote
1answer
337 views

How to optimize 'select found_rows()' query? Several 'high load average' alerts daily

I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies ...
2
votes
3answers
2k views

Convert WordPress posts to products in WooCommerce

Is there anyway I could convert all the posts e have right now on our WordPress install into products using some MySQL query or something like that?
-2
votes
0answers
50 views

Already has more than 'max_user_connections' active connections wp-db.php

ERROR : mysql_connect() [function.mysql-connect]: User already has more than 'max_user_connections' active connections in /nfs/c09/h01/mnt/12345/domains/domain_name/html/wp-includes/wp-db.php on ...
0
votes
2answers
597 views

SQL - Pull products of particular category from a remote WordPress woocommerce db

I connected to the db and successfully pulled products data. Now I want to to display products from specific category. The store is using woocommerce. The landing page is in different location so I ...
0
votes
1answer
617 views

Create an user on external database

I have wordpress site and a project management system from codecanyon. Here is the link I have disabled registration for users in project managment system, only login is enabled. I need to make users ...
0
votes
1answer
16 views

Why doesn't custom mysql query return results? Is syntax correct?

First time making a custom query. I was looking for a way to get a list of categories for a certain taxonomy so I could run a LIKE query for a autocomplete function. Just to get a few results I came ...
0
votes
1answer
17 views

Wordpress unescape text on mysql?

on database i have field desc with value \'test\' actually the input is 'test' when i gather the field for display it on table, it show \'test'\ not 'test' anyone can know how to change the value ...
0
votes
1answer
29 views

Front end access to a SQL data repository - recommended way?

Building a general data repository, not necessarily related to WordPress elements. What is the recommended way of doing it: Using custom post types? or Building new SQL tables? Please elaborate. ...
1
vote
2answers
26 views

wpdb custom post_type problem

I want to use custom post type in my custom SQL query, but, when I add the custom post type im my query, I get no results. Where's my probelm ? This is the code I've tried $top5_ov_performance = ...
0
votes
0answers
11 views

MySQL query to mass change role of users

I'm looking for a MySQL query to achieve this purpose: Change the role of users that never posted and have registered before at least 60 days. The role to be changed to is a new role to be created ...
2
votes
2answers
13k views

Connect to database using wordpress wp-config file

How can I connect to the database using the wp-config.php file ? I'm trying to make a script more Wordpress friendly, and I need to connect to the database, but without installing the script as a ...
0
votes
1answer
15 views

How to select particular month post from table and update the post status using MySQL?

I would like to change the post status for particular month via MySQL command Using SSH...Can you anyone tell me how to do this via SSH. I have number of post more than 40,000 posts, each month i'm ...
0
votes
2answers
24 views

how to check for wordpress Query errors

In mysql or mysqli you can add this type of Query: <?php $sql = mysqli_query($con, Insert into database itt (name) VALUES ($name)") or die(mysqli_error($con)); ?> What does wordpress do ...
0
votes
0answers
10 views

Creating a custom Search Form that links to a custom database?

I'm kinda new in Wordpress and I'm still learning as I go along. Currently, I'm trying to create something like this I have a custom set of database in the server in mysql with a table. The ...
6
votes
1answer
102 views

Reset Post IDs to less than 64bit integer

I have been running Wordpress for many years and have about 26000 posts. At some point my post ids have exceeded a 32bit integer and I am now locked into using Wordpress on a 64 bit system. I am ...
0
votes
0answers
15 views

Can one effectively use non-ClearDB databases on Windows Azure?

Has anyone tried and effectively used a database provider other than ClearDB with WordPress on Windows Azure? I like their service but they are a bit pricey. Since they are the only listed provider ...
-1
votes
0answers
35 views

How to select posts with categories by SQL select

Im trying to show some post from a specific category ( from a custom post type) by sql select, I manage to show all post by: <?php $post_date = get_the_date('Y-m-d'); $start_date = date("Y-m-01", ...
0
votes
0answers
23 views

MySQL errors after a Wordpress clone

I've just cloned one of my wordpress installs on to a different domain, but each time I try to go in to certain setting screens through the dashboard, I get the following messages at the top of the ...
0
votes
1answer
326 views

Unique Post Meta Values

I want to use Unique IDs like YouTube video IDs and WordPress post IDs in a custom field 'youtube_id'. I just created a front-end add post page and want to check if 'youtube_id' used or not used in a ...
3
votes
3answers
8k views

WooCommerce with thousands of products - site is very slow - optimize db queries? [closed]

So far I've got around 8,000 products in my WooCommerce and the product page on the front end takes several seconds to load, even after caching. My VPS host says that I should have multiple ...
0
votes
1answer
45 views

Navigate posts with different post type that are in the same categories

I created two custom post types that share the same category taxonomy. I'm using next_post_link() and previous_post_link() to navigate through posts with the same category but it only works for ...
0
votes
1answer
60 views

Datatabase error: Commands out of sync

I have create function with code bellow: function my_add_new_id ( ) { ... $GetSvrPass = $my_db_connect->get_var ( $my_db_connect->prepare ( 'CALL my_acquireuserpasswd ( %s, @ID, @PASS ) ;', ...
3
votes
3answers
2k views

How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?

Normally, a MySQL database can be exported and imported using these simple SSH commands: Export: mysqldump -u USERNAME -p DATABASE_NAME > filename.sql Import: mysql -u USERNAME -p ...
0
votes
0answers
26 views

Meta query with regular expression

I am using regular expression to refine the post it works fine but i want change it such that it can work with meta query instead of post title here is my code function wpse18704_posts_group( $where, ...
2
votes
1answer
3k views

How to get a Google maps SQL->XML->map marker tutorial to work in WordPress

I have been trying to figure out what is wrong with my code for a couple days now, and I can't seem to crack it. I am trying to follow this tutorial I tried all three of the suggested methods to ...
0
votes
2answers
26 views

Custom Wordpress Table wpdb

running into issues querying a custom table and getting results. As of Wordpress 3.9, I can no longer run mysql_query(), and have to use $wpdb->query(); So keeping that in mind: Old Code: <?php ...
0
votes
1answer
35 views

How do I properly update the Wordpress database password?

A site that I manage was recently compromised and I am going through the steps to harden and re-secure the site. I would like to change the MySql database password and want to make sure I do not take ...
0
votes
1answer
40 views

Insert double entry in DB

I created plugin and my plugin create new Table in DB. My problem is when user type something in field firstname, lastname... and click on button Submit, that go to my table and that is ok.. but then ...
0
votes
1answer
67 views

mysqli_real_connect() - authentication method unknown to the client Warnings

I keep getting the following warnings in my debug log: PHP Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [mysql_old_password] in ...
0
votes
0answers
15 views

filter wptexturize doesn't work on old posts titles

I have an add_filter('the_content', 'wpt_content');. My function wpt_content does a wptexturize($text). But It's work only on save post, so my old post has bad 'and my new post ’. I don't ...
0
votes
2answers
75 views

Reset/Reorder posts ID in the MySQL wp_posts table

I have a Wordpress site that is considerably popular. I am in the process of optimizing the site before adding other plugins such as the WPML plugin which I suspect will be using custom post types. ...
1
vote
3answers
616 views

Site running slow on new server?

I recently uploaded a website to a new 123-reg server on a single WP installation (www.moseleycoachsales.co.uk). I had developed the site on my own hosted multisite environment ...
0
votes
1answer
1k views

meta_query on a date range using an array of values

How can I do a query to return the post if the custom field array contains a date that is within the specified range? The query below is basically what I am after but it does not work... // the ...
8
votes
6answers
37k views

What SQL Query to do a simple find and replace

Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a ...
0
votes
2answers
44 views

Multiple instance of data in plugin custom database table on plugin activation

I'm creating a plugin that adds some data to a custom table created by my plugin on plugin activations. I also created a settings page with a form that users can insert their own data to the ...
1
vote
1answer
531 views

SQL query to update post_date (one post = one single date & time)

I have 120 posts of one category ready for my wordpress blog. For the moment, posts are drafts and I don't want to schedule them manually. I want to publish them like this: 4 articles each day from ...
2
votes
2answers
331 views

Grouping related postmeta data via SQL query

I am using someone else's WP plugin which stores lots of related data in wp_postmeta using an "artificial key". So effectively we hijack wp_postmeta to create a nested relational database. So one row ...
0
votes
1answer
16 views

Getting data from Mysql Table..confusing

I've been pulling my hair out trying to figure out how to do this. I'v created a custom field called cp_country. Now each record in Mysql has a value for cp_country. The problem is i don't understand ...
0
votes
0answers
20 views

Adding a Custom Taxonomy Term to sql union query

There is a beautiful solution to getting the next 3 posts before and after the currently viewed post solved here. However, I would like to narrow the query to just a specific taxonomy term in a custom ...
0
votes
1answer
667 views

“MySQL server has gone away” since update to 3.8

I have a WordPress install on a dedicated server with decent memory (upwards of 8GB). The WordPress install includes many plugins - 50 active plugins. Most important to note is the WPML plugin to ...
2
votes
2answers
73 views

Why does dbDelta() not catch MysqlErrors?

From what I can see, dbDelta() is designed to suppress database errors that occur during its operation. Generally speaking, this seems to be the case, but New Relic is still reporting MysqlErrors ...
0
votes
2answers
37 views

How can I add a user through SQL?

By mistake I just ran this query: (note the extra ;) DELETE FROM wp_users; WHERE ID = 321; How can I add a user through SQL? I searched around but couldn't find a proper answer to this fairly ...
0
votes
1answer
81 views

Delete all subscribers from wp_users and wp_usermeta a few thousand at a time

I have a site with 70K spam subscribers, and I don't need any of them. So I need to delete all subscribers from wp_users and each user's associated meta from wp_usermeta using a query in adminer ...
0
votes
0answers
21 views

Shop coding dynamic permalinks & titles

I have built a shop application using php and mysql and wasn't sure how to add it to wordpress but I had a stab at it anyway, I managed to get it to function fine but because the pages are dynamically ...
0
votes
1answer
30 views

How to sort results from a custom database table

I've created a custom WordPress database table which I'm using to store 'likes'. The columns I have are: id post_id user_id I'm now trying to get an array of post IDs that a particular user has ...
2
votes
2answers
410 views

How is the data stored in the database?

I have years of experience with PHP and MySQL, but just starting to develop plugins for WordPress and need some help. Currently, I am working on a plugin that will add extra functionality to another ...
0
votes
1answer
36 views

Brainstorm - Slow Query from Plugin Need to Speed It Up

We use WP as the backend for a business directory. I have a plugin that queries based upon location coordinates looking for the closest 10 locations to a given "listing". This query is really slow ...
-1
votes
2answers
31 views

Trying to insert a row from a Plugin

<?php require_once("../../../wp-includes/wp-db.php"); wpdb::insert( 'wp_options', array( 'option_name' => 'data1', 'option_value' => 'data2' ) ); ?> I have this code ...