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

learn more… | top users | synonyms

0
votes
0answers
5 views

Wordpress upload images not displaying

Hello I have a wordpress site and I upload images to media library but the images do not display. In wp-content/upload folder there are other folders like 2015/ and then in that folder there are ...
0
votes
0answers
9 views

Custom redirects with using SQL

We have pages with urls like this: http://example.com/?page_id=3&user_id=5 http://example.com/?page_id=6&user_id=9 etc. page_id and user_id located in table MySQL Database. And this table has the ...
0
votes
0answers
14 views

Pages edit as posts

I'm currently dealing with the fallout of the following question (How to change post to page). I got all my pages back though all the pages' URLs were changed so there is no hierarchy and when I try ...
0
votes
1answer
19 views

Converting Posts to Pages

So my site backend had issues and my hosting company had fixed it up for me. In doing that, they inadvertently made all my pages, posts. I'm looking at the database that hosts this and there is a ...
0
votes
0answers
8 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 ...
-3
votes
0answers
19 views

Setup wordpress with mysql database on server

Hi me and my friend we are a team who wants to run wordpress from home. We live quite far and this is the best option for us at this time. We have setup webMatrix which use TFS but when we try to ...
0
votes
0answers
19 views

Why is converting my database to UTF-8 truncating entries?

I'm running WordPress 4.1.1. My site is hosted at NearlyFreeSpeech. I've been using my WordPress blog since the days when it encoded information in the latin1 charset. This week, I realized that ...
0
votes
1answer
22 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
8 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
38 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? [closed]

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
32 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
1answer
12 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
22 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
20 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
97 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
32 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
1answer
25 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
36 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
99 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
85 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
512 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
16 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
62 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
21 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
40 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
37 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
60 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
55 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
52 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
43 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
27 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
38 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
49 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
110 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
52 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
26 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
30 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 = ...