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

learn more… | top users | synonyms

1
vote
2answers
322 views

WP-DownloadManager - Query most download per week/month etc

I'm using this plugin (http://wordpress.org/extend/plugins/wp-downloadmanager/) as my download manager. While it's very simplistic and does great for what i need, the statistics to output on the site ...
1
vote
3answers
339 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 ...
6
votes
1answer
726 views

Would switching to InnoDB from MyISAM improve performance of comments table?

A site I've built gets lots of comments in a short space of time - so perhaps 100 comments might be left in 5 or 10 minutes. This seems to cause a pretty heavy load on the database, especially when ...
1
vote
1answer
2k views

How can I SQL update a meta_value to remove the dollar signs that were entered with the value? (so just the value remains)

For all the "price" custom fields of a site, the dollar sign was entered with the value. I need to remove the dollar sign and leave the just the values. I know very little about SQL queries. The ...
17
votes
3answers
14k views

MySQL Database User: Which Privileges are needed?

The short installation instruction for WordPress ("5 Minutes") state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and ...
0
votes
2answers
8k views

Scanning Database for malicious Data

After a site of a friend has been hacked I told him he should just clean up the mess and restart from scratch so he know that no file has been altered. I could scan the site for him with tools like ...
1
vote
3answers
1k 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 ...
0
votes
1answer
267 views

Custom Search, MySql Query Gone Wrong?

I'm having a bit of a brain fart on this one. I'm working on some code that resembles a custom search form. The custom search form, is a mixture of checkboxes as well as some drop downs. All of the ...
1
vote
1answer
384 views

MySql database help for a plugin

I am using a WordPress plugin called MyReview but I want some changes to it. That plugin has feature to review posts, where users will come and give star ratings to the post according to categories, ...
0
votes
2answers
374 views

Copying post thumbnail to custom field

I've just moved to another theme, and it uses the custom field bigimage for associating an image with a post, instead of using WordPress's post thumbnails. How do I copy the URLs of all existing ...
8
votes
8answers
12k views

How to replace the domain name in a Wordpress database?

I have a Wordpress database which was installed in a development environment... thus, all references to the site itself have a fixed IP address (say 192.168.16.2). Now, I have to migrate that database ...
0
votes
2answers
66 views

Removal of all posts content in bulk, keeping the posts itself

How to, using PHP scripting or WordPress overwrite all of the posts (permamently, so it takes effect on database) with some static text such as "Content removed."?
0
votes
1answer
2k views

query users by role

I have a custom plugin which queries users and usermeta, but I now need to filter admins out of the results. A very simplified version of my sql query is: SELECT * FROM usermeta LEFT JOIN users ON ...
0
votes
3answers
880 views

Code to remove authors with no posts connected to them

I am looking for SQL code that I can run from phpmyadmin to remove all registered users on the blog that do not have any post associated with them.
2
votes
1answer
3k 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 ...
1
vote
3answers
496 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 ...
5
votes
3answers
862 views

Resetting comment count

Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example - ...
1
vote
3answers
455 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
2answers
249 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. ...
2
votes
1answer
208 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 ( ...
0
votes
1answer
666 views

SQL error with custom query

I'm trying to create a custom post query for sorting posts that have been voted "thumbs up". I'm joining my custom "wp_post_votes" table (which stores the number of votes each post received) with ...
0
votes
2answers
1k views

Custom query_posts() parameter

I'm adding voting features to a theme. Visitors can vote posts Up or Down. I created a table for storing number of votes for each post and that works fine. Now I'm trying to sort posts by their votes. ...
0
votes
1answer
134 views

What do these phpMyAdmin errors mean on my WordPress databaes?

I'm getting 3 very similar phpMyAdmin errors on one of my WordPress databases. More than one INDEX key was created for column `comment_approved` More than one FULLTEXT key was created for column ...
2
votes
1answer
541 views

if statement on database query

Part of a voting script I'm working on: I'm checking a custom table in my WP database to see if a user already voted for a post by checking the IP address and the post id. If the user's IP already ...
0
votes
1answer
449 views

Placing a widget with $wpdb query

I'm getting the feeling that adding Widgets via MySQL query is not as simple as I thought. I was under the impression all data is stored in the options table, but it seems like I was wrong. Any idea ...
2
votes
1answer
73 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 ...
0
votes
1answer
1k views

add_action for publish_post doesn't work

I'm working on a personal voting plugin, I don't intend to release it publicly because I'm still learning WP. In general, you can vote posts "up" or "down". I have 2 tables, one collects IPs (to ...
1
vote
1answer
745 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 ...
0
votes
2answers
858 views

query_posts meta_key with current date

How to query Post with current date month with custom field: Here is my code <?php global $wp_query; $event_month = get_post_meta($wp_query->post->ID, 'eventdate', true); ...
1
vote
3answers
184 views

Recent comments from my blogs only

I'd like to create a list of recent comments, specific to each user on my network (Buddypress). My best idea so far is pretty lame: DB Query on all user's blogs, compare dates, select top 10 by date. ...
0
votes
2answers
1k views

Wordpress(wpdb class) and mysql stored procedures

$query = "CALL .........."; $result = $wpdb->get_results($query); print_r($results); Is returning an empty array and $wpdb->query does not return anything, how do you run stored procedures from ...
0
votes
1answer
563 views

saving the widgets position after drag and drop

I have created a web application in which I have 3 columns, or i would say left sidebar, right sidebar and a middle widget area, I have few widgets in the left sidebar, few in the right sidebar and ...
1
vote
1answer
3k views

SQL query to select posts from multiple categories

I have built a query to select posts within a category. Works fine. But when I choose to add a secondary filter to exclude a category, the query return the same result set, as if the secondary ...
4
votes
1answer
439 views

What specific database privileges does WordPress need?

I want to create a new database user for my WordPress installation. Usually on localhost, i can just use root, but it is good practice to use a user with as little rights as possible. What are those ...
33
votes
6answers
31k views

Using wpdb to connect to a separate database

I want to connect wpdb to another database. How do I create the instance and pass it the database name/username/password? Thanks
1
vote
3answers
780 views

WordPress Custom Query

I have posts that use a custom field for start date and end date. query_posts returns an array of posts that exist in the category I'm filtering. How do I query posts using this custom field that has ...