Contact Us Today! | vcare@wdmtech.com

WDMtech

Topic-icon Dinamic condition based on user->id from Joomla

  • Zaheer Abbas
  • Zaheer Abbas's Avatar
  • Visitor
  • Visitor
2 years 2 months ago #1037

Hi ANTONIO RUEDA,

Thanks for contact us.Can you please send us your back end login credentials via Contact Us form. We'll look into the issue.

thanks
zaheer

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

  • ANTONIO RUEDA
  • ANTONIO RUEDA's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 2 months ago #1036

Hello Danish,

I need additional information. I have created a graphic using the sentence
SELECT Mes, Dato1, DatoGrupo FROM Int_Prueba;
and I get a graphic

When I tried to add the where condtion
SELECT Mes, Dato1, DatoGrupo FROM Int_Prueba WHERE AGENTE='{loggedinuserid}'
I have some error messages
1. Horizontal Value get a empty value and a error message: 'Invalid field: Horizontal Value()'
2. I put the same data serie that the first sentence without where clause, and in this case i can save the graphic, but when I do preview I get the error message: 'Data Column/s for axis#0 cannot be of type string

Please, do you have any documentation with examples about using parameters in sql sentence.

On the anohter hand, do you have any list of joomla parameters that we can use in sql sentence.

Thanks in advance,

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

  • Daniel
  • Daniel's Avatar
  • Away
  • Administrator
  • Administrator
More
2 years 2 months ago #1035

Hello Antonio,

Here is the example:
userid = {loggedinuserid}

There is an option in back end to write your custom query, you can include the above condition in that query.

userid is column name, you need to change it as per the column name in your database table.
{loggedinuserid} is the keyword which will be replaced automatically with logged in User ID.


Thanks
Daniel

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

  • ANTONIO RUEDA
  • ANTONIO RUEDA's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 2 months ago #1034

Hello Danish,

Could you send me an example.

Is this condition right?

User = <?php return JFactory::getUser()->id; ?>

Thanks

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

  • Daniel
  • Daniel's Avatar
  • Away
  • Administrator
  • Administrator
More
2 years 2 months ago #1033

Hello Antonio,

Yes it has the feature to include dynamic variables in your SQL query including logged-in User ID :)

Hope I could precisely reply to your question.


Thanks
Daniel

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

  • ANTONIO RUEDA
  • ANTONIO RUEDA's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 2 months ago #1032

Hello,

Is there any option to include a 'extra condition' related to sql query, based on user->id from Joomla.

I want to show information from a table filtering by the id joomla user

Thanks in advance,

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