Title: [sqlgetvar]
Last modified: August 29, 2020

---

# [sqlgetvar]

 *  Resolved [davitabile](https://wordpress.org/support/users/davitabile/)
 * (@davitabile)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/sqlgetvar/)
 * Hi Eli,
    I hope you could help me with this issue: the following query
 * SELECT arg_id FROM vrb_new_arg WHERE arg_id=<?php $_GET[wpda_search_column_arg_id];?
   >
 * works fine if I use the regulart shortcode
 * [SQLREPORT name=”sqlvartest”]
 * However in this form
 * [sqlgetvar]SELECT arg_id FROM vrb_new_arg WHERE arg_id=<?php $_GET[wpda_search_column_arg_id];?
   >[/sqlgetvar]
 * I obtain the following result
 * This SQL Query has not been allowed by an Administrator.
 * But if I sobstitute the this method <?php $_GET[wpda_search_column_arg_id]; ?
   > with the actual url parameter like this
 * [sqlgetvar]SELECT arg_id FROM vrb_new_arg WHERE arg_id=2 [/sqlgetvar]
 * the result is correct
 * could you help me with this?
 * thanks a lot
 * Daniele
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsqlgetvar%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Eli](https://wordpress.org/support/users/scheeeli/)
 * (@scheeeli)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sqlgetvar/#post-13335851)
 * There are many reasons outside of the control of my plugin that the SQL Query
   you are entering into the shortcod in your content area might be getting altered
   before the shortcode itself is executed. There are even core functions of WordPress
   that will “make pretty” the contents you enter, even with a shortcode, and before
   the shortcode is evaluated. You can try debugging the code by outputting the 
   $MySQL variable that is received by the ELISQLREPORTS_get_var function so that
   you can see exactly what part of your code is being changed, or you can just 
   stick to using the slug for your SQL Query in place of the whole Query itself,
   like this:
    [sqlgetvar]sqlvartest[/sqlgetvar]
 *  Thread Starter [davitabile](https://wordpress.org/support/users/davitabile/)
 * (@davitabile)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sqlgetvar/#post-13340587)
 * Hi Eli thanks a lot for your quick reply
 * this [sqlgetvar]sqlvartest[/sqlgetvar] effectively works!
 * Daniele

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

The topic ‘[sqlgetvar]’ is closed to new replies.

 * ![](https://ps.w.org/elisqlreports/assets/icon-256x256.png?rev=1231385)
 * [EZ SQL Reports Shortcode Widget and DB Backup](https://wordpress.org/plugins/elisqlreports/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elisqlreports/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elisqlreports/)
 * [Active Topics](https://wordpress.org/support/plugin/elisqlreports/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elisqlreports/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elisqlreports/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [davitabile](https://wordpress.org/support/users/davitabile/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/sqlgetvar/#post-13340587)
 * Status: resolved