Title: Cant use sql queries in wordpress post??
Last modified: August 19, 2016

---

# Cant use sql queries in wordpress post??

 *  [gvanto](https://wordpress.org/support/users/gvanto/)
 * (@gvanto)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/cant-user-sql-queries-in-wordpress-post/)
 * For my blog [http://blog.sharedigest.com](http://blog.sharedigest.com) I have
   quite a few code snippets, one of them being some mysql code which, when I post
   it, goes to a ‘you dont have rights to this server’ (error page) message which
   is probably a security thing to prevent sql injection.
 * I have seen many other blogs posting sql to their pages and was wondering how
   to overcome this problem?
 * I have just instaleld the syntaxHighlighter plugin and still get this error…
 * Many thanks for any help,
    Gert

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/cant-user-sql-queries-in-wordpress-post/#post-1208843)
 * If you are trying to _display_ the code in your post, try this plugin:
 * [http://wordpress.org/extend/plugins/wp-syntax/](http://wordpress.org/extend/plugins/wp-syntax/)
 * If you are trying to _execute_ the code, then put it in the relevant theme files(
   single.php, etc.).
 *  Thread Starter [gvanto](https://wordpress.org/support/users/gvanto/)
 * (@gvanto)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/cant-user-sql-queries-in-wordpress-post/#post-1209116)
 * Thanks iridiax, (its for displaying sql queries yes) I’ve tried using:
    <pre 
   lang=”mysql”> show tables;
 * which works OK ([http://blog.sharedigest.com/optimizing-mysql-1-using-indexes/](http://blog.sharedigest.com/optimizing-mysql-1-using-indexes/))
 * but the following select statement still gives the ‘cant post due to access error):
 * <pre lang=”mysql”>
    select * from t1;
 * Its mega frustrating, if anyone has ideas, would eb greatly appreciated !
 * gvanto

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cant use sql queries in wordpress post??’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [gvanto](https://wordpress.org/support/users/gvanto/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/cant-user-sql-queries-in-wordpress-post/#post-1209116)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
