47 Posts
sebg
10 years ago
5
Topic
Hello,

I try to construct a select dynamic with current user id in the "Where" SQL condition, but no succes.
Do you know if it is possible ?

Bonjour,

Je travaille sur un site d'offres d'emploi. Je voudrais que les personnes qui insèrent des annonce ne puissent le faire que dans les institutions auxquelles lls sont liés. A cet effet, je cherche à créer une liste dynamique avec l'id de l'utisateur dans la clause "Where" de MySQL.
Savez-vous si c'est possible ?

D'avance merci





Get a Book for SEBLOD
47 Posts
sebg
10 years ago
0
Level 1
Hi,

Nobody knows a solution ? Maybe you need more details ?

Thanks,
Seb
47 Posts
sebg
10 years ago
1
Level 2
Hi Zwergo,

Thank you for answer but I don't find here the solution.

I would like to insert the id of the current in the sql query In User, but I do not know how to retrieve the user variable in the SQL command.
I find yesterday this post , but if a solution exists without hack, I would prefer that. Do you know one ?

Thanks,
Seb


47 Posts
sebg
10 years ago
0
Level 4
Hi Zwergo.

It is a Typography plugin. If I understand, I can't use it in an admin or site form, just in Intro and content.


10 years ago
0
Level 1
Hello sebg,

If I get you right, I don't think that you need the Databaser plugin.

You need to get the id of the currently logged in user, right?
Something like this should work:
WHERE c.author_id = [userid]

Of course you will have to adapt the "c.author_id". If you are querying the #__content table it would be
WHERE created_by = [userid]

10 years ago
0
Level 1
Honestly, I don't know. I got that piece of code from an old forum post and have not tried it myself.
jos_ really is you DB table prefix?
What version of Joomla and Seblod are you on?
Get a Book for SEBLOD