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

learn more… | top users | synonyms

0
votes
1answer
20 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
20 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
20 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
9 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
0answers
3 views

select permission not working for dynamic table created via stored procedure [migrated]

Inside the stored procedure i created dynamic temp tables with system time. table created with name like this 'temp_ccdata_20140904101131_2' I want to give SELECT permission for some of my SQL Users ...
-1
votes
0answers
12 views

How to Import CSV in a Repeater Field [closed]

How to Import CSV in a Repeater Field(ACF)? I have a list of car with multiple different specification so i want the specification name and size to be added/append in a repeater field. e.g. ...
0
votes
1answer
18 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
15 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
177 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
11 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
19 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
21 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
20 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
10 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
47 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
17 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
31 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
48 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
5 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
48 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
24 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
34 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
49 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 ...
1
vote
1answer
19 views

Moving test theme to live site without mySQL error - how? [closed]

I have installed a wordpress theme on a hidden test site and made some css/design changes. How would I move this to my live site? Sadly I screwed up some of the PHP/MySQL stuff when trying to copy ...
0
votes
1answer
42 views

WP_USE_EXT_MYSQL

Here is the constructor for the wpdb class as found in the source code. According to a google search this has been recently renamed from USE_EXT_MYSQL. However I cannot find anywhere in the source ...
0
votes
1answer
11 views

How to restore: Database intact but folders deleted

I never thought I'd come to having to ask this question -- one trusts web hosting companies to keep our data intact, but somehow they have deleted my entire Wordpress installation while leaving the ...
1
vote
2answers
55 views

Select Multiple meta_value from WP DB; Single Query

I am trying to retrieve each user's first and last name, phone, email, and address from the usermeta table. I'm having trouble selecting multiple meta_values, each with its own meta_key, using a ...
0
votes
1answer
64 views

Query to change custom post type with specific category

I need to change several hundred posts with custom post types to regular post type but only from one category within that custom post type. So I have a custom post type 'films' and within that post ...
0
votes
1answer
48 views

How to run this SQL query of wp_terms database

I have the following tables (only pertinent info included for brevity and clarity) Table Name: wp_term_relationships object_id term_taxonomy_id 1266 1341 1266 452 1266 449 ...
0
votes
1answer
25 views

Copy wp_postmeta from one database to another

I had a site setup on old-domain.com, which used the database old_db. Recently, we had to migrate our website to a new server and domain, new-domain.com which uses the database new_db. I installed a ...
0
votes
0answers
29 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
1answer
19 views

Obtaining user table for one site on multisite set up

I'm trying to select only users that are registered for a specific site on my multisite set up and see that the table for the users has collected everyone that is on the network. Is there away I can ...
5
votes
2answers
105 views

Ordering posts by day (not time) AND meta value

I would like to have a list of posts that is first ordered by day, and then within that day ordered user votes (stored as a meta field). Would it be better to convert each timestamp to the day at ...
0
votes
1answer
39 views

Second completely independent and disposable Wordpress installation in subdirectory?

I know this may have been asked before, but I didn't find an exact answer, so yeah ... I have a wordpress installation in the main directory of my Webspace (hosted @ Strato) and I want to install a ...
0
votes
1answer
32 views

How do post IDs work in WordPress?

So I have 2 blog posts so far and the first one has ID 8 and second one has ID 12. How exactly does WordPress count those IDs? What if I want to change ID 8 and ID 12 to ID 1 and ID 2? I have some ...
0
votes
0answers
59 views

Add delete/edit button to each row in an SQL table (Wordpress Backend)

I have a form that is submitting entries to a table in the backend of my Wordpress installation. I would like to add edit/delete buttons to each row so that an administrator can delete submissions or ...
1
vote
0answers
26 views

Problems accesing my site [closed]

I was building a new site with WP, but when I checked it with various servers on http://www.host-tracker.com/InstantCheck, most of the request are returning with a 503 error. In addition my memory ...
0
votes
0answers
17 views

Check role in database

I'm developing a script outside of Wordpress that needs to work with the Wordpress database and our website. I just need to check if the role of a user is our custom role (already defined) of ...
0
votes
1answer
23 views

Making CURDATE() recognize current_time()

I'm trying to make this query pull a list of users 30 days from today that have a birthday. This query works as per below in WordPress, but excludes those who have birthdays as today. I believe the ...
0
votes
0answers
19 views

Database solutions for a commenting plugin?

(I'm new to this and am aware that my questions are vague and kind of suck, please bear with me.) My plugin, a commenting platform, is in the directory. Currently, it doesn't have it's own database. ...
0
votes
0answers
17 views

Close secoundary database connection

I have two website. first one is in wordpress and second one is in corephp. My Question is that i am connection database by $wpdb. /* Core php database */ $newwpdb = new wpdb( 'username', ...
0
votes
0answers
15 views

Incorporating a meta query into a mysql query in wordpress

I'm trying to find a way of inserting a meta condition into this bit of SQL below... $query = "SELECT COUNT( ID ) as num_events " . "FROM $wpdb->posts " . "WHERE ...
0
votes
2answers
46 views

get_results suddenly not working on a single table

I'm trying to get a list of rows from the DB. All tables work except the one I need. No errors are thrown, don't even get a blank array. My SELECT statement works fine in phpmyadmin directly, but not ...
0
votes
1answer
18 views

How to change the publishing date of each posts? [duplicate]

I need to set the publishing date of many posts with the post date (the creation date). I know that I can do it editing the single post and changing the Published on value but this procedure is ...
0
votes
0answers
22 views

How to handle this problem related to the publishing date of imported posts?

I have the following situation that I have to handle: I imported some posts from an old custom blog (not WordPress, a custom blog made using ASP). I exported in CSV format the content of the table ...
0
votes
1answer
18 views

What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?

I have the following doubt related to the posts table of the WordPress database. I see that when I create a new post in this table are automatically created 2 new rows. 32 1 2014-08-16 15:07:22 ...
0
votes
1answer
14 views

Why when I create a new post I found 2 record related to this post into the posts database table?

I am very new in WordPress development and I have a doubt about the WP database table named posts I have observe that when I create a new post (into the WP administration panel) are created 2 record ...
0
votes
2answers
16 views

Will reducing mysql permissions hinder WP function? [duplicate]

While installing WP, I created a mysql user to access only the relevant WP database. It's likely that not technical people will end up with access to this account, so I decided to remove DELETE and ...
0
votes
1answer
85 views

Custom MySQL Query for Post and Post Meta

I have a custom table called "tags" that contains a charity_id that is a reference to a post ID ... I need to query the "tags" table to grab this charity_id and then pull in the post title and a few ...
-3
votes
3answers
31 views

how to show the data from a myqsl database in a post [closed]

im new with using wordress. I am trying to make a website that would show the data table from my mysql database. or is there any free plugin that will be able to do this?