Title: Variables really variable with shortcode?
Last modified: June 22, 2017

---

# Variables really variable with shortcode?

 *  Resolved [toooni](https://wordpress.org/support/users/toooni/)
 * (@toooni)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/variables-really-variable-with-shortcode/)
 * Hi,
 * How can i pass a dynamic value to the statement if this dynamic value is not 
   available before the user opens the page?(the serialized php way is to difficult
   for me)
 * I tryed to do something like this (in a Site):
 *     ```
       [insert_php]
   
       Some code to get the tribeid of the actual user...
   
       echo "[wpdatatable id=1 var1=".$row['tribeid']."]";
   
       [/insert_php]
       ```
   
 * Unfortunately this doesn’t work. The variable is not passed to the SQL statement.
   
   If you give a static value to this variable, then it works. I really do not understand
   why it works when i add a static variable, but it doesn’t work when im getting
   the variable with some php code?
 * Is there a way to do what i tryed with the above code? I need real dynamic tables
   with real variables which are changeable at runtime (changeable by php code in
   this site).
 * Thanks and best regards,
    Toni

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

 *  Thread Starter [toooni](https://wordpress.org/support/users/toooni/)
 * (@toooni)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/variables-really-variable-with-shortcode/#post-9254912)
 * Can be closed.
 * Serialized php array seems to be the only way.
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/variables-really-variable-with-shortcode/#post-9259361)
 * Hi there, thank you for your inquiry,
 * The lite version doesn’t support these functionalities, only available with the
   Full version.
 * One suggestion as you are comfortable with PHP would be to use built-in hooks
   to adjust the returned data or the query for the particular table or page.

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

The topic ‘Variables really variable with shortcode?’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/variables-really-variable-with-shortcode/#post-9259361)
 * Status: resolved