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

learn more… | top users | synonyms

0
votes
1answer
15 views

Wordpress Insert not working with ajax

I am trying to enter insert data with form in wordpress and want to use ajax for that. Without ajax it works fine but when I use ajax pressing the submit button gives 0 in result and the data is not ...
0
votes
0answers
7 views

Widgets with *internal* links do not display after database migration

I am using Grunt to dump my local db, search and replace URLs in it (and account for serialization by using grunt-peach based on Peach), send it to my staging server, then import it into my staging ...
0
votes
0answers
37 views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', ...
0
votes
0answers
4 views

Do you know a database or file manager for users plugin? [on hold]

I save a lot of data for some clients in Excel files (currently working on exporting this as sql records). I need to have this databases (1 database per client) stored on my wordpress web so my ...
0
votes
0answers
27 views

Sanitize a working query string by using $wpdb->prepare() fails with MySQL DB error “right syntax to use near '3' at line 1”

I was using the following properly working query so far: $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta1, $wpdb->postmeta wpostmeta2 WHERE wposts.ID ...
0
votes
0answers
12 views

php echo from Database is not working? [closed]

I am using a shortcode on my Wordpress pages to implement php scripts. I am using $wpdb codex to connect and manipulate with db. Please check the code below. I just want to echo some data on the ...
0
votes
1answer
10 views

Why won't this wpdb get_results query return results?

Having trouble with this query. It returns an empty array even though I know the variables are correct and that multiple rows exist in the database that match. $results_a = $wpdb->get_results( ...
0
votes
0answers
18 views

Using $wpdb (WPDB class) 'replace' with multiple WHERE criteria problem

I have two fields that are used to identify a particular row (acting as a composite key). If it does not exist, I wish to insert a new row. The REPLACE function ...
0
votes
1answer
23 views

MySQL queries in Wordpress

I have a MySQL database table called stock which holds a stock record on items for sale. When querying the database using PHP I have no issue, but when I try to do it through WordPress it doesn't ...
0
votes
1answer
17 views

You have an error in your SQL syntax - Help with query

I have a programmer that developed a custom plug in for a client's website and after moving the site to client's server, some parts are not working. Looking at the error log, there is an issue with ...
3
votes
2answers
93 views

Return only Count from a wp_query request?

Is it possible with the standard build-in tools in Wordpress to get wp_query to only return the count of an query? Right now, I’ve a query which has several meta_queries but what the only thing I’m ...
0
votes
1answer
31 views

Wordpress plugin: efficient way to store large data

I have excel file with 1000+ records. Basically it has zipcode and corresponding email addresses. I need to create a custom wordpress plugin which queries this data and sends the mail. It would be ...
0
votes
0answers
19 views

using a function in functions.php to process a form generated in functions.php

so i have a site where users can rate items, it saves their ratings to a mysql db and also tallies the average for the item, saving that as well. as it is a generic function and there are hundred of ...
0
votes
0answers
13 views

SQL error on restoring database

I am running a database backup -- a 7 MB SQL -- using the phpMyAdmin Import function and getting an error, whose text doesn't really show where the problem is. MySQL said: Documentation #1064 - ...
0
votes
0answers
32 views

is_user_logged_in() not working after domain change

I am relatively new to Wordpress and I recently moved a WordPress website from one domain to another. I went through and fixed all the links and references that I could find. Now my website has all of ...
5
votes
1answer
85 views

Automatically delete inactive users after 2 months

I am trying to modify this function: // automatically delete users after 7 days in wordpress function wcs_auto_delete_users() { global $wpdb; $query = $wpdb->prepare( "SELECT ID FROM ...
0
votes
2answers
78 views

MySQL database gives blank page (white screen of death)

I am currently trying to migrate a live Wordpress site to a local server to do development. I believe I have done most steps correct, but I am only getting a blank page. I am quite certain that this ...
0
votes
1answer
18 views

Write mysql credentials in plugin

I've to create a custom plugin to print data from a database different from the wordpress one. I'm using wpdb. Is it fine, from a security point, to write database credantials in the plugin files in ...
0
votes
2answers
95 views

Why are no posts showing despite my apparently correct DB restoration?

I restored a backup to MySQL using the phpMyAdmin Import feature. When I browse the DB in phpMyAdmin, I see that my posts are there. But in Wordpress, I only see the default out-of-the-box welcome ...
-1
votes
2answers
385 views

Dynamically populate Cascading Dropdown from MySQL using JQuery/AJAX [closed]

What I'd like to achieve is managing tables in the front-end of a WordPress page the same way as MS Access does. So, I'd like to show dependent cascading dropdown which are related by foreign key and ...
0
votes
0answers
25 views

Update table only if checkbox is clicked

I'm building a little home security project where it should be able to turn the system on/off from a website and by a password on the device. My problem seems to occur with the code from my website. ...
0
votes
1answer
17 views

Help with sorting and storing data on Wordpress

I want to implement something where users can log in and review products and search for products to see reviews. I want to store multiple attributes to allow for really refined searches. I need things ...
0
votes
0answers
15 views

WP Query with multiple posts and meta queries

I have three custom post types: Stories, Venues and Cities. With Advanced Custom Fields I have added a related custom field to each post type. Each Story has a Venue ID and each Venue has a City ID. ...
2
votes
1answer
58 views

SQL query to get adjacent posts from search query

I'm busy rewritting a custom function I have recently written to get adjacent posts according to a tag, category, custom taxonomy term, author or search value saved in the URL I'm using the structure ...
0
votes
1answer
20 views

using same mysql user with many databases

As we know that in order to connect WP with database we should to define mysql username and password in wp-config.php, so at that point i have a question regarding security or ( some sort of ...
0
votes
0answers
35 views

MYSQL sleep process for 20 seconds while site is “waiting for…”

I'm running WP 4.0.1 on an Ubuntu VM server. The server has no outside internet connection, so I have enabled define('WP_HTTP_BLOCK_EXTERNAL', true); in wp-config.php. When I click a link on the ...
0
votes
1answer
33 views

Using WPDB->Insert()

Hello I have been developing in PHP and now am just starting the transition to Wordpress. In PHP I have this -> // Prepare statement $sqlstatement = $conn->prepare("INSERT INTO importtest ...
1
vote
1answer
58 views

MySQL 5.5 upgrade 'broke' Wordpress [closed]

I upgraded from Debian 6 to 7 and during the upgrade, MySQL asked for new root password, I was little confused but typed it anyways. I guess this created a new database called 'mysql', because now ...
0
votes
0answers
14 views

Database Errors and User Permissions [duplicate]

I'm working on a customer's pre-existing site and I notice a ton of errors in the server logs. A typical error is WordPress database error DELETE command denied to user 'xxxxxxx'@'localhost' for ...
0
votes
0answers
15 views

How to make list of checkboxes based of number of distincs value of some custom field?

I need to make list of checkboxes based of number of distincs value of some custom field (Country) for visitors able to choose only post where this field Country the same as they are interested one. ...
1
vote
1answer
16 views

Search and replace in post content

I am about to change themes on my site and also a plugin that creates tabs with a post. I need to replace multi-line text with other multi-line text and can't work out how to do it. I have tried ...
0
votes
0answers
49 views

MySQL 1005 ErrNo 1 - “can't create table” when importing DB backup into phpmyadmin?

I have been developing a WordPress site locally using the following mysql version: LOCAL DATABASE SERVER: Server: Localhost via UNIX socket Server type: MySQL Server version: 5.5.40-0ubuntu0.14.04.1 ...
0
votes
1answer
50 views

WPDB secure custom form

I'm creating a custom form to update rows in a secondary MYSQL DB, different from the one of wordpress. This form is public and every user can access it. So I've created a plugin and I'm using also ...
0
votes
1answer
39 views

Hide Administrators From User List except current user (administrator)

this code works great! the problem is that this code also hide the current user (if administrator) so what i trying to to do is hide all Administrators except current user. i need help to edit sql to ...
0
votes
0answers
24 views

Translate SQL query to wp_database with JOINS into wp_query

StackExchange members! It's so happened that I'm using straight SQL queries in my application. I'd like to rewrite it and use WP_Query, but, unfortunately, I have no idea how to translate, let's say, ...
0
votes
1answer
37 views

MySql Database In WordPress Multisite

I have a multi-site installation. It's a fresh installation, and currently all the sites use the same database. What would you recommend among these and why? Pros and Cons of using the same? Option 1 ...
0
votes
1answer
30 views

How do i get value from wp_postmeta?

I am trying to get a specific value from wp_postmeta, I'm aware about meta_key and meta_value. Problem is Meta value stores lots of values and i want specific value. Here's the value in the ...
1
vote
1answer
45 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
103 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 ...
0
votes
1answer
51 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
25 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
36 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
29 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
40 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
37 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
31 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
42 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 ...
7
votes
1answer
117 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
51 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 ...
0
votes
0answers
32 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 ...