SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).

learn more… | top users | synonyms (1)

0
votes
3answers
750 views

How do I move a Wordpress site to another server?

i'm using this sql.. but it does not work UPDATE wp_options SET option_value = replace(option_value, 'http://old.com, 'http://new.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE ...
2
votes
1answer
265 views

Bulk add tag (or any sort of label) to posts who have custom excerpt

The situation is the following: The blog as of now has 2200+ posts. In the beginning (2007/2008) I was using manual excerpts where I would put an image and a little bit of text. The manual excerpt ...
12
votes
3answers
369 views

What are the common security flaws I need to look for? [closed]

As a wannabe WP plugin developper, what are the main security flaws/holes I should look for? I'm about to create a new plugin with a configuration panel (ie input fields and stuff). What should I be ...
2
votes
2answers
3k views

Query between two meta values?

How do I limit the query by two custom meta fields, a start date and an end date? This is what my data looks like: meta_key | meta_value | ------------------------| start_date | 20100131 | //Jan ...
2
votes
1answer
256 views

Querying Email Addresses for a List of Users with Same Last Name?

I have a site with many users and many of them have the same last name. I want to get the emails of all the users with the same last name (IE: Smith) that has a post related to a particular taxonomy ...
8
votes
2answers
13k views

WP_Query with “post_title LIKE 'something%'”?

I need to do a WP_Query with a LIKE on the post_title. I started with this regular WP_Query: $wp_query = new WP_Query( array ( 'post_type' => 'wp_exposants', ...
2
votes
4answers
5k views

Most efficient way to get posts with postmeta

I need to get a bunch of posts with their metadata. Of course you can't get metadata with a standard posts query, so you generally have to do a get_post_custom() for each post. I'm trying with one ...
3
votes
2answers
350 views

Sharing database for collaborative development

Is there a straightforward way to share/sync multiple WP instances with a single database? I work collaboratively with several developers on custom themed sites. We use git to keep our files in order ...
3
votes
1answer
895 views

Is it possible to wrap Geo Location search around WP_Query?

I'll just like to add that I have a current working solution in place and works well but I'm looking for ideas of being able to do it better or cleaner if possible. We have hundreds of properties in ...
2
votes
3answers
5k views

Pagination with custom SQL query

I have my own SQL string to select Custom Post Type posts with specific WHERE clause. I've used the offset and limit to return appropriate posts depending on a page being displayed. That's working ...
0
votes
2answers
326 views

Moving an entire wordpress site from one domain to a new domain and database

I have done all the steps requiered to import the dump.sql file to new database, and copiey the entire content from the old domain over to the new one. When i login to mydomain/wp-admin, i'm ...
3
votes
2answers
1k views

SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'… stops working when value is over 999

Overview: I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts... just the value itself. Details: I have added a custom meta_key ...
0
votes
2answers
749 views

Up/Down voting system for Wordpress

Looking in all posts with keywords "voting system, upvote, downvote", I can't find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding ...
4
votes
1answer
175 views

prepare() not working

When I do this: $transients = $wpdb->get_col( " SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_transient_wb_tt_%' " ); It works ...
2
votes
2answers
521 views

How to properly sanitize strings without $wpdb->prepare?

I'm working on an advanced search (which uses custom sql queries), and the query string is formed using variables. For example, if the person checks some options, only those conditions get added to ...
2
votes
2answers
343 views

Moving database with phpMyAdmin

I have a remote (website) version of a wordpress site and it's got more recent information than my local (computer) version. I would like to move the data over to my local using phpMyAdmin, what is ...
2
votes
1answer
216 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 ...
0
votes
1answer
34 views

Extending the database

I'm trying to add an extra column to the comments database which will store the user ID of the post/page author. This is part of a plugin which will display new comments in reply to either a post or ...
0
votes
1answer
92 views

An action hook where a comment meta is updated

By analogy to the hook on post meta update, I use the following code for hooking when comment meta value is updated. My comment meta key is "consider" and can have 2 values: 0 and 1. My Goal is to ...
0
votes
2answers
118 views

Really simple query giving error in SQL syntax

I'm sure this is a simple oversight but I cannot seem to narrow it down: global $wpdb; $tablename = $wpdb->prefix . "icrm_folders"; $sql = $wpdb->prepare( "SELECT * FROM %s", $tablename ); ...
0
votes
2answers
702 views

Error establishing a database connection After Copy localhost wordpress site (with site url directly to hosting server's url before copy)

I have a localhost site that I heard I can migrate the site by just copy and paste the whole site from local to host if I changed WordPress Address (URL) and Site Address (URL) to my current hosted ...
0
votes
1answer
90 views

Proper approach to moving complete site from one domain to another AND preserve widgets

I consider myself fairly versed in this matter, however I've recently had a rash of issues when moving sites. I am able to successfully move the site, edit wp-config.php, move the database, etc. ...
-2
votes
1answer
1k views

cleaning up safely wordpress wp_postmeta table

In a effort to facilitate maintenance of my site, optimise page loading , and also helping out db migration , i am trying to cleanup the wordpress database of my site. i ahve realised the wp-postmeta ...