I'm having problems with using %VAR% in a SQL Query:
SELECT '%VAR1%' FROM mytable WHERE year(DATE) = '%VAR2%';
VAR2 works as expected but the moment I place single quotes on VAR1 the data dissapears. If I remove the single quotes the table works in the preview but the VAR does not work in the shortcode.
I tried reading all FAQ's, Instructions and watched videos but I cannot figure out how to solve this.
I have tried al sorts of single quotes everywhere but I'm afraid I need help.
Sorry for disappointment but variables are not working in SELECT statement in our plugin. Can you please describe me in more details what you are trying to make so I can gave you suggestion?
I have a database with many tables all containg 6 colomns (DATE, ITEM1, ITEM2, ITEM3, ITEM4, ITEM5)
I want to show 1 ITEM on a page together with a DATE
my plan was to use one table with your plugin:
SELECT (ITEM) FROM (TABLE) WHERE DATE = (DATE)
doing:
SELECT '%VAR1%' FROM '%VAR2%' WHERE DATE = '%VAR3%'
Your instructions told me I could use %VAR% in the SQL query, if this is not working in the SELECT statement it would be nice to mention so in the douments. Is it also not working in the FROM statement?
First of all thanks for a great plugin!
I'm having problems with using %VAR% in a SQL Query:
SELECT '%VAR1%' FROM mytable WHERE year(DATE) = '%VAR2%';
VAR2 works as expected but the moment I place single quotes on VAR1 the data dissapears. If I remove the single quotes the table works in the preview but the VAR does not work in the shortcode.
I tried reading all FAQ's, Instructions and watched videos but I cannot figure out how to solve this.
I have tried al sorts of single quotes everywhere but I'm afraid I need help.
Just to be clear…I forgot to mention that '%VAR1%' is a colomn name
In adition: I removed the ";" in my query, but that did not solve it…
Hi flovanroijen,
Thank you for your purchase.
Sorry for disappointment but variables are not working in SELECT statement in our plugin. Can you please describe me in more details what you are trying to make so I can gave you suggestion?
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
I have a database with many tables all containg 6 colomns (DATE, ITEM1, ITEM2, ITEM3, ITEM4, ITEM5)
I want to show 1 ITEM on a page together with a DATE
my plan was to use one table with your plugin:
SELECT (ITEM) FROM (TABLE) WHERE DATE = (DATE)
doing:
SELECT '%VAR1%' FROM '%VAR2%' WHERE DATE = '%VAR3%'
Your instructions told me I could use %VAR% in the SQL query, if this is not working in the SELECT statement it would be nice to mention so in the douments. Is it also not working in the FROM statement?
Hi flovanroijen,
If you have more tables in database with same structure and different data you can use query:
SELECT * FROM %VAR1% WHERE date_column ='%VAR2%'
And then you can hide columns that you don't need with option Visible on front-end on DISPLAY tab in column settings.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Hi Milan,
Thx for the quick and usefull replies. Together with your answher on a different ticket about SQL views it seems that I can solve my issues.
(maybe a suggestion to add to the docs that %VAR% works in FROM and WHERE and not in SELECT)
Thank you and have a good day.
Hi flovanroijen,
You are welcome. Glad that we help you. Thakn you for reporting this I will forward this to my team to update the documentation.
If you have any more issues feel free to open a new ticket, we will gladly help.
We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks!
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables