Contact Us Today! | vcare@wdmtech.com

WDMtech

Topic-icon Using of variables in SQL query

More
8 months 1 week ago #3490

Hello,
SEF URL do not affect this functionality but as you said It's not working, It means the variable is not available in ID parameter. Please find it out which variable is being used and then update accordingly.


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Jan Vašátko
  • Jan Vašátko's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 1 week ago #3489

Hello, I found when I use SEF URL (domain/category/id-alias), it is not working. If I put e.g. ?id=123 after it is working. Is it possible to use it with SEF URL?

Please Log in or Create an account to join the conversation.

More
8 months 1 week ago #3484

It seems to be the id variable is not available in GET / POST data. If it is, Please share your FTP & Backend Login credentials via Contact us form, We'll look into it.


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Jan Vašátko
  • Jan Vašátko's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 1 week ago #3481

I have tried it, but when I use vchart module e.g. in article with id=123

select x, y
from #__table
where id = {id}

does not work (nothing shows). If I set

select x, y
from #__table
where id = 123

it is working. Are there some restrictions or should I use it spcial way-

Please Log in or Create an account to join the conversation.

More
8 months 1 week ago #3479

Hello,
If Article ID is there in get / post data, then it can be used. And in frontend Article ID is available in "id" variable, that's why you should use {id} ( id get variable is available on Article detail layout if you are intending to display the module on Article detail layout )


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Jan Vašátko
  • Jan Vašátko's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 1 week ago #3478

Hello, you write

Write Your SQL Query: If you want to write your custom MySQL queries to fetch data in order to generate charts, click on the “Write Your SQL Query” Button. A text area will be display with some notification saying that system will consider the first column for Horizontal value and except the first column, rest of the columns will be consider as series.

You can also include dynamic variables in your SQL query. You just need to enter variable name within curly braces. e.g. {catid}. {loggedinuserid} is reserved for Logged-in User


I don't understand the usage of the variables - what exactly are these variables? I would like to use SQL select like

select x, y
from #__table
where id = {articleid}

{articleid} should be the ID of the actual article. Can I use it this way? The purpose is to show different chart in every article.

Jan

Please Log in or Create an account to join the conversation.