MySQL is an open-source, relational database management system.
2
votes
1answer
175 views
Inserting Hundreds of Thousands of Posts at Once
I have a project in which I create an array of 200k+ lines w/ 25 fields that run the wp_insert_post and update_post_meta. To start it processes pretty fast the slows down a lot after 10k records or ...
2
votes
1answer
1k views
delete unused postmeta
I love the comment by s_ha_dum : http://wordpress.org/support/topic/sql-query-to-delete-postmeta and havent tried it yet, but Im wondering just how 'clever' this actually is?
Does the unused postmeta ...
2
votes
1answer
1k views
Get Previous & Next posts by Post ID
How can I go about getting the previous and next posts from outside the loop? Everything I try to do aside from the custom SELECT query (using get_posts or WP_Query) breaks stuff further down the ...
2
votes
2answers
184 views
Tons of Twitter rows in my database
I have 264,307 "http" (post_type = http) rows in my wp_posts table. 99% of those have them have this post_title:
GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100
and "error" ...
2
votes
1answer
380 views
Problems with DBDelta with FOREIGN key?
I have the following sql I am using with dbDelta:
$sql .= "CREATE TABLE " . $location_table . " (
location_id MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
name VARCHAR (100),
...
2
votes
1answer
346 views
Split a database will improve performance?
Hi to all I'm running a Wordpress MS installation and I would like to move a couple of heavy "sub" blogs on a different DB, will it encrease my performances? Actually I'm on a dedicated server with ...
2
votes
2answers
2k views
Importing users to Buddypress with custom fields
Here's the setup:
The client uses a proprietary
custom-coded PHP CMS and is wanting
to move to WordPress with BuddyPress.
The old, custom CMS has a roster
functionality, which I'm using
BuddyPress ...
2
votes
1answer
65 views
How to run scripts when a new blog is created in Buddypress?
I'd like to insert some mysql data into every new blog that's created on my buddypress system. How can I hook up to the newly created blog data? ID, for example, would allow me to insert it right from ...
2
votes
2answers
476 views
Check if post of title already exists
I'm writing a plugin that takes an xml feed and posts it into WordPress using wp-cron
Everything is working dandy, except it keeps adding the same posts over again.
So, I'm working on a system to ...
2
votes
1answer
192 views
How to change post format from Aside to Image for all posts?
I have a blog where all the posts had the post format Image. This morning I see that somehow they have all been changed to Aside. I'm still trying to figure out how this happened, but in the ...
2
votes
1answer
43 views
can database and media folder be moved to a different drive?
I have to move my site from Drive C:\ to Drive E:\.
Is there a better way to do this than uninstalling the following:
Wordpress
PHP
MySQL
Apache
and re-installing on Drive E:\?
For example, how ...
2
votes
1answer
35 views
What is the most secure way to set up the MySQL user in WPMU?
I am setting up Subdomain based MU on my domain.Everything is hosted by me running on one CentOS/Webmin VPS. Will I be better off setting the MySQL user's domain as localhost, 127.0.0.1 or with a ...
2
votes
1answer
253 views
Increment value (value = value+1) of $wpdb->update
This sql query
$wpdb->query("UPDATE log SET total=total+1 WHERE id='1')");
How do I turn it into $wpdb->update() statement?
Ex.
$wpdb->update('log', array('total'=>'total+1'), ...
2
votes
1answer
164 views
Multipart/formatted MySQL query problem
I'm creating a plugin and I want to automate the creation of a MySQL Trigger on a table. The problem seems to be that $wpdb->query doesn't appear to accept either multipart statements and/or formatted ...
2
votes
1answer
395 views
How many 'wp_insert_post' calls can be performed in one shot, in a very long 'for' loop?
I'm working on a plugin which has bulk post inserts using a spreadsheet. This spreadsheet can have multiple thousand rows, each row corresponding to a post. I'm parsing this spreadsheet, looping over ...
2
votes
2answers
411 views
Fulltext search in posts sorted by relevancy
I'm building a custom search page and what I need is to sort results by relevancy (eg. occurences of a keyword)
Using MySQL docs I've built this query:
SELECT ID
FROM $wpdb->posts
WHERE MATCH ...
2
votes
0answers
39 views
Query meta field using between
I'm trying to Query some lattitude and logitude and then I get some long numbers and apperently the Query dont like that.
Let says I have these in the database
Meta-key: lat
Meta-value: 54.3415000
...
2
votes
1answer
152 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 ...
2
votes
2answers
313 views
mysql custom wp query
this code is designed to select posts with selected meta value in wordpress query
<?php $values = $wpdb->get_results("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ...
2
votes
1answer
111 views
theme options echoing multiple times
I tried to strip down the Twenty Eleven theme options page and add my own fields correction: I followed a tutorial somewhere, but when I try to echo the data, it comes out multiple times.
Here is my ...
2
votes
1answer
486 views
PHP/MySQL issues when running WP on EC2 cloud [closed]
I am trying to create a wordpress blog on an Amazon EC2 instance. The amazon base image had apache and php already installed. I installed MySQL manually in my user directory. I am able to login to the ...
1
vote
3answers
366 views
Insert all post IDs in new database table
I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table?
Right now I'm using an action hook to immediately insert the ...
1
vote
3answers
395 views
Search and replace text across all posts
I had used the ZD Video Plugin for WP a long time, and now, since my move to WP 3.0.2, it doesn't work anymore. To embed a YouTube video using the plugin, I would just write
...
1
vote
1answer
421 views
Wordpress 3 - how are passwords stored and how do I compare to them?
For reasons I can't go into right now, I'm creating a form that will allow users to change their passwords for Wordpress by entering their current password and then entering the new password.
I want ...
1
vote
3answers
93 views
Styling images coming from another blog
I had asked a question earlier, on getting post-thumbnails from another WP-site. There, the awesome Mike coded a SQL query whose results are then passes on to a PHP array. The piece of code from that ...
1
vote
2answers
334 views
what to do when your WordPress database is too large?
Well I have asked this question in WP Forums, StackOverflow, and GoDaddy community as well, but nothing worked out. Hoping something is in here.
I used 2 separated subdomains for my blog and site ...
1
vote
2answers
466 views
How to create another version of my site based on the same database
I have created a site and would like to create another version of the same site using the same exact database (db location, users, everything). The two sites would share one database. I already have ...
1
vote
2answers
4k 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?
1
vote
2answers
219 views
greatest() function returns undefined property
I'm using the mysql GREATEST() function to compare two table fields and display in a loop either one with the highest integer value. The 2 fields consist of vote scores for posts: UP or DOWN.
...
1
vote
1answer
38 views
Universal problem: first request after ~25 second inactivity always slower (~1 second) than subsequent requests (~1/10sec)
It's something I noticed ever since I started working with WordPress. It's a universal issue, in the sense that it doesn't matter if the WP installation is on my shared hosting account (haven't tried ...
1
vote
3answers
221 views
Delete post revisions on post publish
Is it possible to delete post/page revisions from the database when a post/page is published?
11/05/12 Answer: See the plugin below by bueltge
I want to do this on a site with 5,000 posts and ...
1
vote
3answers
1k 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 ...
1
vote
2answers
235 views
Mysql query LIKE not working
I'm using this code.
$blog_list = $wpdb->get_results( "SELECT " . $extra . "blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' ...
1
vote
3answers
738 views
MySQL query to set wp_postmeta using term_taxonomy_id value
I have a need to set the wp_postmeta value (in table: wp_postmeta) on every post that has a specific term_taxonomy_id (in table: wp_term_relationships):
Specifically:
run a query against every ...
1
vote
1answer
123 views
Large database causes slow load
I have a 2GB WordPress database (using InnoDB Storage Engine) and I noticed my site loads slow when I press the publish button right after I selected a featured image in the media library.
I had a ...
1
vote
2answers
212 views
How to create and work with custom data / tables (i.e., for arbitrary data)?
Getting started on Wordpress just today. I noticed that Wordpress created tables in a mySql database (with name *.wrdp1) when I first set it up. These tables cover comments, posts, users, and some ...
1
vote
1answer
170 views
How is the data stored in the database?
I have years of experience with PHP and MySQL, but just starting to develop plugins for WordPress and need some help.
Currently, I am working on a plugin that will add extra functionality to another ...
1
vote
2answers
433 views
Import 10,000 Users into Wordpress WITH a specific ID for each user
I have a website which has about 10,000 users. I am converting this site over to Wordpress. The new site is ready to roll, but I have to bring over all the users.
There are a number of plugins ...
1
vote
1answer
157 views
Rewrite database urls
Is there a query I can run on my wordpress database so that I can change all instances of
www.mydomain.com
to
localhost/mylocalsite.com?
1
vote
1answer
404 views
Is it possible to split database tables using HyperDB?
I'm looking for an answer from someone who's implemented HyperDB or has knowledge of it.
I have a database which has just passed the 100mb mark a week or so ago, the problem is my host only allows ...
1
vote
1answer
364 views
Disallow categories from this MySQL query
I'm trying to modify a plugin that generates an archive listing so it shows only one category, making it a single category archive.
The old version of the plugin used a get_posts query, and so it was ...
1
vote
3answers
301 views
Performance on WPMS
my WPMS site is hosted on 8 cores/32mb RAM server but the response time is very high.
We have about 1000 blogs (35,000+ tables on single db) and 70,000 pageviews per mounth.
I think that i can down ...
1
vote
2answers
599 views
importing users where password is provided as md5 + much metadata
I have a spreadsheet that was provided to me of users to import to a new site I have built. I was provided with the password in MD5 hash form. I suspect if I insert this into the password field in ...
1
vote
1answer
188 views
WP database error for comments_popup_link()
I'm using the comments_popup_link() function to show the number of comments for each post in a loop.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( ...
1
vote
1answer
547 views
Adding new row to wp_post table
I want to add 2 more rows (for voting up or down) to my default wordpress posts table. Would those rows be deleted when I update my WP version, or cause any other problem? An alternative would be to ...
1
vote
1answer
53 views
How to prevent execution of default query, while preserving ability to use WP_Query in template?
PROBLEM: I'am trying to prevent execution of default WordPress query for custom category template. I have found a possible solution, but looks like it preventing execution of all post queries:
...
1
vote
1answer
67 views
How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
I have multiple custom tags setup (ptags) and custom posttypes (products) and made it so i can filters posts by multiple tags in a category.
Currently the code retrieves tags from posts relating to ...
1
vote
2answers
220 views
How to do a MySQL dump from production site without using a search and replace script for local development?
I performed a MySQL dump of my WordPress production database to be imported into my local development environment. I plan on frequently performing this database dump and import. Is it possible for me ...
1
vote
2answers
160 views
$wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
It's easier if I made an example:
I have a custom post type MYPOSTTYPE, with 3 taxonomies TAX_1, TAX_2 and TAX_3
If I have 3 terms: 'TERM_TAX_1' in TAX_1, 'TERM_TAX_2' in TAX_2, and 'TERM_TAX_3' in ...
1
vote
2answers
134 views
Join new table with SQL query
I created a plugin with a new table (wp_soundcloud) and I need to retrieve the data from that new table along with the post data.
Here is my query:
$querystr = "
SELECT $wpdb->posts.*,
...