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

learn more… | top users | synonyms

0
votes
0answers
23 views
+50

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 ...
2
votes
1answer
2k 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 ...
1
vote
1answer
16 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 ...
0
votes
1answer
21 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
27 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
1answer
25 views

Is MySQL query cache useful for WordPress?

Starting from MySQL 5.6, if you use InnoDB as the default engine, the query cache is now officially disabled. We've a quite moderate traffic WordPress site and experience a major downtime when we ...
0
votes
0answers
13 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
23 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
2answers
1k views

phpMyAdmin error #1062 - Duplicate entry '1' for key 'PRIMARY'

I'm new to PHP! I'm trying to import an SQL file using phpMyAdmin through a GoDaddy cPanel(please don't make fun of me) Here's a full readout -- -- Dumping data for table `wp_commentmeta` -- INSERT ...
2
votes
2answers
4k views

How to validate WordPress generated password in DB using PHP?

I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and to check user login, Logging users outside WP. I tried with md5 of password but it's not... ...
1
vote
2answers
878 views

MySQL Syntax Error upon restoring database from backup [on hold]

Performed a bad import to my Wordpress install and decided to restore from the mqSQL backup (full export) I had made minutes earlier. Dropped all tables in the database and then did an import from my ...
0
votes
2answers
36 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
0answers
13 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
14 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
18 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
14 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
12 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
1answer
468 views

How to check for empty and not a failure

I'm querying the postmeta table to see if a url has already been entered, using this statement (where $thisLink is the url I'm checking) $mypostids = $wpdb->get_results("select * from ...
0
votes
1answer
14 views

How to change the publishing date of each posts?

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
1answer
560 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 ...
0
votes
0answers
10 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
15 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
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
23 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 ...
0
votes
1answer
13 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 ...
-3
votes
3answers
28 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?
0
votes
1answer
500 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 ...
5
votes
4answers
7k views

What are the recommended database permissions for WordPress?

I just got WP running on my own server. I am not trying to lock things down more. What permissions should the db user have to my WP db?
0
votes
0answers
29 views

Exclude posts from certain meta_key

I have query to retrieve all posts, but how can I check the condition for post meta_key ="develop" and meta_value='anything' SELECT DISTINCT date(p.post_date) as post_date FROM $wpdb->posts p ...
0
votes
1answer
245 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 ...
1
vote
0answers
33 views

Slow wp-admin due to “SELECT DISTINCT post_mime_type FROM wp_posts WHERE post_type = 'attachment'”

The media library on a large site is slow in wp-admin. I did some research by looking into slow queries in the sql and found that this query is causing the slow response: SELECT DISTINCT ...
1
vote
1answer
297 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 ...
1
vote
3answers
377 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
48 views

Adding data to custom wordpress database table

I have a form on a page that populates the database table: <table border="1"> <tr> <td align="center">Form Input Employees Data</td> </tr> <tr> ...
0
votes
1answer
20 views

How to pass username into form that sends data to database

I am trying to pass username to database through form: [insert_php] $current_user= wp_get_current_user(); $id= $current_user->user_login; [/insert_php] <input type="hidden" name="id" ...
0
votes
0answers
17 views

How to connect database table to each registered wordpress user.

When registered user visit certain page, I want him to be able to add some 3 column data to a database that can be retrieved for him later. The way I see it implemented is by automatically adding an ...
0
votes
1answer
672 views

How to import database table as custom post type and custom fields?

I have a sql table that contains vehicle information. When I import the database table to my WordPress website, I need the information to be imported as custom fields for a custom post type. For ...
1
vote
5answers
6k views

Will it break my site if I delete all transient records in wp_options table?

My site currently has an outrageous 500k+ transient records in the wp_options table. This causes the table to be crashed frequently and so be my site. I thought transient records will all expired ...
0
votes
1answer
77 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 ...
1
vote
1answer
116 views

Separate DB by yearly archive of Wordpress

I have large DB of blog post I already export it by year and wanted to make archive by year doing it on subdomain, like 2012.mysite.com I stack looking for solution on internet, I wondering if their ...
0
votes
0answers
34 views

Long query apache error from spam comments

My hosting company recently turned on the error reporting for slow queries in php/apache and we have seen the error logs get flooded with errors all from queries requesting spam comments on the front ...
0
votes
0answers
11 views

why ’ quote double quote in database wordpress

i'm trying backup and restore database using php code. but i don't know why quote double quote show in database wordpress, something like ’, and destroy my wiget_text. So how can i fix that.? help ...
2
votes
2answers
293 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
435 views

wpdb->insert multiple record at once

So after I have created the table 'settings-table' i want to add a couple of records to it. This is how I want to do it, not the best way, so I need a better way to do this because I will add more ...
0
votes
1answer
42 views

Complicated MySQL Query

I'm trying to build a directory of members that has some search options at the top. Each member has several custom fields as well (using Advanced Custom Fields). Would like to have a single query ...
0
votes
1answer
14 views

how to insert missing tags into the posts through mySQL?

I am looking for a SQL query to insert a tag to multiple posts from a specific category. A pseudo query looks something like this: INSERT INTO POSTS VALUES TAG = "tagName" where Posts ...
0
votes
0answers
48 views

Can't Post to my Wordpress Anymore!

I'm at my rope's end with this whole thing and have tried everything I can to solve it. I have a WordPress site with a SQL database on Azure, but recently all of the users associated with the site ...
0
votes
0answers
16 views

new multisite, old db

I'm trying to get my old posts from a WP install that was in a sub-directory on my site, into a new Multisite install on a new host. The new install is doing what it should. the problem is the posts ...
0
votes
0answers
11 views

Wordpress Database Duplicate Entry Error (Cron specific)

This is one error that my website is continuously generating in the error log file. WordPress database error Duplicate entry '59199038' for key 'PRIMARY' for query INSERT INTO `admission_options` ...
0
votes
1answer
44 views

Slow Wordpress admin panel with a total query time of 1664ms

I have a problem with my wordpress website, he is realy slow, i installed a debug bar to check queries in the home page, the result is like: 202 queries, and a total query time equal to 1665ms The ...