Title: SQL Table Lookup
Author: harvest316
Published: <strong>August 19, 2014</strong>
Last modified: August 19, 2014

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/sql-table-lookup.svg)

# SQL Table Lookup

 By [harvest316](https://profiles.wordpress.org/harvest316/)

[Download](https://downloads.wordpress.org/plugin/sql-table-lookup.zip)

 * [Details](https://wordpress.org/plugins/sql-table-lookup/#description)
 * [Reviews](https://wordpress.org/plugins/sql-table-lookup/#reviews)
 * [Development](https://wordpress.org/plugins/sql-table-lookup/#developers)

 [Support](https://wordpress.org/support/plugin/sql-table-lookup/)

## Description

You can use these SQL lookup shortcodes to extract data from any table in your WordPress
database:

[sql query=”SELECT a FROM b WHERE c=’d’;”]

[sql]SELECT a FROM b WHERE c=’d’;[/sql]

[sql table=”b” unique_lookup_field=”c” lookup_value=”d” return_field=”a”]

If a table or column name has a space or other unusual character in it, wrap it 
in `backticks`. If a value contains a
 space or other unusual characters, wrap it
in ‘single quotes’.

While I’ve taken considerable effort to prevent SQL injection attacks by escaping
all other dangerous characters with esc_sql (which uses mysql_real_escape_string/
mysqli_real_escape_string and addslashes), I would advise against using this plugin
on a site that accepts any kind of posts or comments from untrusted sources.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“SQL Table Lookup” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ harvest316 ](https://profiles.wordpress.org/harvest316/)
 *   [ Seo ](https://profiles.wordpress.org/seo/)

[Translate “SQL Table Lookup” into your language.](https://translate.wordpress.org/projects/wp-plugins/sql-table-lookup)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/sql-table-lookup/),
check out the [SVN repository](https://plugins.svn.wordpress.org/sql-table-lookup/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/sql-table-lookup/)
by [RSS](https://plugins.trac.wordpress.org/log/sql-table-lookup/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Version **0.1**
 *  Last updated **12 years ago**
 *  Active installations **10+**
 *  WordPress version ** 3.0 or higher **
 *  [Advanced View](https://wordpress.org/plugins/sql-table-lookup/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/sql-table-lookup/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/sql-table-lookup/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/sql-table-lookup/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/sql-table-lookup/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/sql-table-lookup/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/sql-table-lookup/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/sql-table-lookup/reviews/)

## Contributors

 *   [ harvest316 ](https://profiles.wordpress.org/harvest316/)
 *   [ Seo ](https://profiles.wordpress.org/seo/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/sql-table-lookup/)