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

learn more… | top users | synonyms

0
votes
1answer
175 views

How i can obtain all the post meta for a specific post as an array?

<?php $fields = get_post_custom($ID); ?> This will fetch the custom fields ($key => $value) for $ID in to the array $fields. I want ALL the fields (both custom & standard WP fields) ...
12
votes
2answers
4k views

The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?

Lately I've been reading about MariaDB and Percona Server, two strong alternatives to MySQL that have gained popularity since Oracle bought Sun. As far as I know, both of them could be used with ...
1
vote
2answers
305 views

Help running a MySQL query to update all wp_#_options tables in a Multisite install

I'd like to run a query through my WordPress database that updates the blog_public values on all individual sites. I'm stuck on how to have the statement look for wp_2_options, wp_3_options, etc. I ...
1
vote
1answer
628 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?
0
votes
1answer
146 views

Wordpress tables and aliases?

I have imported some tables from my online wordpress database to my local to work on. However now I am getting some weird sql errors that I don't get online. I can see that the code of the plugin I ...
1
vote
1answer
544 views

User management system similar to wordpress one?

I am in very big need of a user management system just like the one that wordpress uses but without being blog related. I need to be able to manage users and apply certain privileges depending on user ...
0
votes
1answer
311 views

How to create a blogs category page with Blog-Types Plugin

I'm not a web developer so I don't know how to create an sql query to display information from my database. Here's what I wanted to do, I want to have a page that will display blog categories. When a ...
2
votes
1answer
1k 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 ...
0
votes
2answers
344 views

WordPress & MySQL , problem with use many array in meta_query

I use this code for display custom posts : $args = array( 'category__in' => $bookcat, 'meta_query' => array( 'relation' => 'OR', array('key' => 'bookname','compare'...
0
votes
2answers
835 views

Help!! I Screwed up my WP

I was trying to clear up some empty tables left behind by other previously used plugins. As such i was trying to delete the GD Star rating plugin and now I cannot access my WP admin. i get the 'You do ...
0
votes
2answers
190 views

Why doesnt my tag page populate with this custom post type?

I have a tag page that is generated with the first image attachments from all of the posts. I call it in the loop with : <img src="<?php echo get_first_attachment() ?>" /> and this is ...
1
vote
1answer
602 views

Importing Geo data into wordpress database

I have a listing wordpress site and want to integrate geo data into the Wordpress MySQL Database for custom search functionality I want to utilize different aspects to create different things... ...
3
votes
3answers
807 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 (...
1
vote
1answer
2k views

tag search using WP_Query

I need to find only posts with a tag forest gump. I've tried: new WP_Query('tag=forest+gump');, new WP_Query('tag=forest gump');. However they both return ALL the posts and not only the posts with ...
0
votes
1answer
808 views

How to add categories using mysql

I have an excel sheet with 423 categories consisting of US States > Military Bases. Is there a way I can reformat the excel sheet and import the categories into the wordpress database? I know how to ...
1
vote
2answers
2k views

Mass convert MySQL data entries into custom post type?

I have a MySQL table with about 500 rows of entries each containing: title, author, series, and series number. Would anyone know how to mass convert the data into (1 entry per post) custom post type ...
3
votes
1answer
1k views

importing data from non-wordpress mysql db

I have created an import file to get the articles from a non-wordpress db and bring them in as posts in wordpress, I am not sure how to bring over the thumbnail image into my custom field I defined as ...
4
votes
2answers
3k views

Get posts by menu ID

I'm a little stuck here. I have a menu in Wordpress with some posts in it. What I would like is to retrieve all the posts as objects. I think I'm pretty close, but the SQL query doesn't seem to work ...
2
votes
2answers
2k 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 (...
0
votes
1answer
443 views

Speeding SQL queries for a large database?

I am using a WordPress plugin called feedwordpress in order to run a planet like website on wordpress (See it here). The plugin is great except for one thing - it hogs down my (VPS) server into ...
1
vote
1answer
4k views

How to Mirror WordPress database from Remote server to Local server

Before I embark on this tutorial from the WordPress Codex on mirroring a WordPress database from a remote server to a local one. I'd like to get some feedback from SE users who have successfully ...
0
votes
1answer
519 views

Global MySQL replacing of text patterns/matches

I'm familiar with this method... update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); The problem is, I'm trying to do this to all ...
0
votes
2answers
2k views

Configure Wordpress to connect to Mysql DB using SSH tunneling

Problem: Configure wordpress to use a remote mysql database only available using and SSH tunneling. Stage: I have a wordpress instance over an apache server on machine (called WP_server). WP_server, ...
18
votes
3answers
14k views

Should I use wpdb prepare?

I'm new to SQL and am wondering if I need to use wpdb->prepare for the following query to a table I've created global $wpdb; $tablename = $wpdb->prefix . "my_custom_table"; $sql = "SELECT * ...
0
votes
2answers
749 views

Wordpress Custom Query: Combining Two Functions

I'm a bit new to php and am having some trouble combining the functionality of two custom queries in Wordpress in order to (1) get pagination to work properly, and (2) sort my posts according to a ...
1
vote
1answer
366 views

Wordpress Post # of # filtered by category slug

I want to show post #4/100 at the top for each post for which I'm using following code function updateNumbers() { /* numbering the published posts: preparation: create an array with the ID in ...
2
votes
2answers
14k views

Using Dynamic Data Pulled from a MySQL Table in a WordPress Page

I'd like to pull data from a mySQL database and put it in some tables in a WP page. I'm using WP 3.1.1. Imagine that I've got a table of sales figures that I want to pull from a mySQL database and ...
2
votes
1answer
1k views

How to Delete Old Comments by Date?

I run a contest/giveaway blog at www.mommylivingthelifeofriley.com and currently have over 160,000 comments on 1100 posts. I would like to find a way to delete all comments from my site which are ...
1
vote
1answer
1k views

SQL query to delete comments older than 90 days?

I'm working on a site that has 150,000 comments with an obvious hit in performance; is there an SQL query that can delete all comments older than say 90 days? They're not spam comments, and they are ...
2
votes
1answer
731 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 ...
1
vote
2answers
3k views

How to remove duplicate Custom Fields?

I have migrated my blog from blogspot to WordPress. Then I have noticed many of the posts contain duplicate custom fields. Like blogger_author, blogger_permalink, blogger_blog are duplicated upto 5 ...
4
votes
7answers
2k views

WordPress MySQL & PHP Performance

have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and ...
3
votes
1answer
613 views

Return ID of authors who have at least one post

I found a great piece of code here that returns the ID's of users by role. What I would like to do is modify it so it only returns the ID's of the users who have at least one post. I have tried to ...
1
vote
1answer
1k 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 ...
0
votes
1answer
549 views

latency problems with wordpress install (from SQL import)

I develop wordpress sites for a living, and today I am experiencing something that I haven't yet come across: Extremely slow load times / latency problems. You can view the site here: http://...
0
votes
1answer
50 views

What's the sql for this condition?

I want to delete all records from wp_usermeta with user_id whose meta_value is "tonetone" which is spam accounts. As you know already, there are many records with one user_id in wp_usermeta. I tried ...
1
vote
1answer
757 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 ...
0
votes
1answer
254 views

Only allow user to access a link once a year, based on their joining date

I am using Wordpress to run a membership site, and one of the features is that members can download a badge. However, they are only allowed to download the badge once per year, starting form the date ...
0
votes
2answers
2k views

MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?

EDIT: I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a ...
0
votes
1answer
390 views

Returning info from MYSQL table via custom taxonomy

Update: I'm now trying to find a way to echo the metadata of a custom taxonomy's value. I'm trying to create some PHP to use in a plaintext widget that'll display information in my sidebar. Because ...
6
votes
2answers
7k views

Checking if Database Table exists

I read the wordpress codex and professional wordpress. It seems both use something like if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { to determine if the table exists. Is ...
1
vote
1answer
1k views

Call to undefined function get_user_meta() - trying to access data in MySQL from custom fields

I am trying to access data from some custom fileds in my MySQL db so that I can add them to a webpage that will be printed out. The data is held in a column called "paypal_user" and I need to access ...
1
vote
3answers
1k views

My WordPress site always displays a cached version of its homepage

First of all, sorry if I'm making a mistake. I already asked this on the ServerFault forum, but got no answers at the moment and I thought it would be a good idea to ask the question here, considering ...
2
votes
1answer
2k views

Split WP install between 2 databases?

Is it possible for Wordpress to work from two databases? The reason I ask is that we're approaching our 100mb limit for database size on our host (1and1) but have up to 100 databases, so what I was ...
0
votes
1answer
497 views

Wordpress and MySQL: trying to print data using PHP from user_meta custom field data

I have some custom user_meta fields in my MySQL database. The data is stored in my DB as follows: the meta_key is called "paypal_user" and the info is stored in the meta_value column as: O:11:"...
1
vote
1answer
452 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 ...
3
votes
1answer
662 views

Using source control with WordPress

I just recovered from a pretty bad crash using Server 2008 Shadow copy. Ultimatly I didn't lose more than a few hours of work but a loss is a loss. I've decided to move to version control to prevent ...
0
votes
2answers
356 views

Deleting post tags removes categories

I'm trying to remove old post tags from a few WP installs. In some instances, I have over 20k tags for a few thousand posts. I've tried the following code: delete t.*,tt.*,tr.* FROM wp_terms AS t ...
0
votes
1answer
393 views

Copy price categories to custom field

I have just made a big mistake today using a plugin to convert my 1000+ price custom fields into child categories under Price. I didn't know the custom fields will be deleted after the conversion. ...
1
vote
2answers
901 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 ...