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

learn more… | top users | synonyms

0
votes
1answer
15 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 ...
-2
votes
0answers
35 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
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
28 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. ...
0
votes
0answers
8 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 ...
1
vote
2answers
23 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
1answer
13 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
23 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
7 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
101 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
14 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
24 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
42 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
56 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 ) ;', ...
0
votes
0answers
22 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, ...
0
votes
2answers
24 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
37 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
34 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
55 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
73 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. ...
0
votes
2answers
40 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 ...
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
17 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
2answers
36 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
74 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
29 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 ...
0
votes
1answer
35 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
30 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 ...
0
votes
0answers
33 views

Install will not load: PHP does not have MYSQL installed

I'm having trouble installing Wordpress on my Windows 2008 R2 server. I'm getting the message: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. To ...
0
votes
0answers
66 views

`#1215 - Cannot add foreign key constraint

create table wp_pageviews ( ID BIGINT(20), count integer, primary key(ID), FOREIGN KEY (ID) REFERENCES wp_posts(ID) ) Error : #1215 - Cannot add foreign key constraint ...
0
votes
1answer
34 views

How to Import Multiple Values in custom field

I want to know how to import multiple values in a custom field, I am quite familiar in using custom field for single values but for multiple values is what I am having trouble with for example my csv ...
0
votes
0answers
36 views

SQL command to export post_content from wp_posts using phpMyAdmin

I'm trying to select all the data from within the post_content column in the wp_posts table in WordPress so I can export/import it into a new database. Somehow this content didn't properly make it ...
1
vote
1answer
226 views

MySQL LIKE not working

It seems MySQL's LIKE operator behaves like a = operator. The following MySQL query returns the expected result (1 entry): $meta_key = '_locality'; $meta_value = 'The Hague'; $post_ids = ...
0
votes
0answers
20 views

Bulk assign Categories by ID

I have several hundred posts that need to be recategorized. I have all categories established and know the category IDs that need to go with every post ID. Some posts need to be assigned multiple ...
0
votes
0answers
49 views

Import SQL tables from SQL file on plugin install

I'm building a plugin, on installation of the plugin it needs to create several tables. Now I found out that I can do that in the plugin code sorta like this.. // Function to create new database ...
1
vote
1answer
42 views

How to prevent/delay MySQL connections when an object cache is used?

We are using an object cache backed by memcached, however I think that WordPress will still connect to MySQL on every page load, which shouldn't be needed if all queries can be handled by the object ...
0
votes
2answers
34 views

$wpdb->get_var multiple queries in one database check

I am using the $wpdb->get_var php code to get the first name and last name on the records, in the wp_usermeta table... But because the field value is stored in the same cell, I don't know how to merge ...
0
votes
0answers
13 views

mysql full text search wordpress for title

whats wrong in this code. its not working.please help <?php if( is_single() ){ global $post; $specific_u1 = 'sonam sharma'; $specific_u2 = 'akhilesh kumar'; $post_author_id = ...
0
votes
1answer
104 views

How To Make Connection To WordPress Data Base In A Plugin?

I am learning Plugins and I am trying to connect WordPress database wp-config.php in my Plugin PHP code. Currently for checking my code, I used the below connection and it is working fine. Now I ...
0
votes
0answers
22 views

Wordpress MySQL query to add multiple users with related article

What I need is to add 100 users to wordpress and each one should have one post assigned to him, like a profile page (I don't want to use the default wordpress profiles because in the feature each user ...
0
votes
1answer
49 views

Using 'mysqli_connect' 'crashes' Wordpress client-side

I am using Wordpress as a CMS for a bus-route planner, I have inputted the first few bus stops for the first bus route and am now developing a PHP script for the planner. I am using this code, with a ...
1
vote
1answer
199 views

Wordpress database import: Row size too large

I've done a dump of my Wordpress database using Windows's command prompt: mysqldump -u username -p databasename > filename.sql Then, on a different server, imported it using: mysql -u username ...
0
votes
0answers
7 views

custom table records not inserted

I want to get all posts and insert all of them into a custom table. But I got an error, saying that all rows in custom table are empty. Why ? <?php global $post; $args = array( 'numberposts' => ...
0
votes
1answer
108 views

How do i append UNION SQL Query with default search query

Example: (SELECT ID, post_status, post_title, post_excerpt, post_content FROM wp_posts WHERE ((`post_title` LIKE '%2020%') OR (`post_excerpt` LIKE '%2020%') OR (`post_content` LIKE '%2020%')) AND ...
0
votes
1answer
34 views

Multisite Tables the same as Single Install?

Are the tables created for each individual site/blog on Multisite the same as single? Can I do an SQL dump for each MS table and import it to a single install?
0
votes
1answer
56 views

Advanced SELECT query with condtional statements

I am having trouble understanding the proper way to write an advanced select query. I have the following the code here. if (!empty($_GET['3321body_type'])) { $bt = $_GET['3321body_type']; ...
0
votes
0answers
70 views

mysql Join wp_users,wp_usermeta and a custom table

I am doing a search functionality based on three fields: servicename, state, zipcode. I have to filter the users. The servicename is in a custom table named wp_doc_services, while the other two fields ...