Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 89

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

165 votes
Accepted

How to display SQL query that ran in query?

If you run the above code anytime while the loop is still active or even right after the loop it should give you the SQL from the loop. …
MikeSchinkel's user avatar
  • 37.5k
1 vote
Accepted

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

/wp-load.php' ); $sql =<<<SQL SELECT DISTINCT u.user_email AS user_email, um.meta_value AS user_lastname FROM {$wpdb->users} AS u LEFT JOIN {$wpdb->usermeta} AS um ON u.ID = um.user_id LEFT … ; $sql = $wpdb->prepare( $sql, 'Smith', 'baseball' ); $usersemails = $wpdb->get_results( $sql ); header( 'Content-type:text/plain' ); print_r( $usersemails ); …
MikeSchinkel's user avatar
  • 37.5k
2 votes
Accepted

Overriding default calendar to show posts from a category

$find,$replace,$body); return "{$header}<tbody>{$body}"; } function query($query) { if ($this->category) { global $wpdb; $find = "FROM {$wpdb->posts}\\s+WHERE"; $add =<<<SQL … calendar_term_relationship.term_taxonomy_id INNER JOIN {$wpdb->terms} calendar_term ON calendar_term.term_id=calendar_term_taxonomy.term_id WHERE calendar_term_taxonomy.taxonomy='category' AND calendar_term.slug='%s' AND SQL
MikeSchinkel's user avatar
  • 37.5k