Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Query

13 years 9 months ago #151026 by laptoproadie
CB Query was created by laptoproadie
How do you use substitutes in the queries?

I'm trying to do login auditing, by just inserting a record into a table whenever anyone logs in. I don't know how to do this, though.

INSERT INTO jos_login_audit (user_id, ip,timestamp)
VALUES (**user_id?**, **ip?**,DATETIME())

If I have the above query, what do I put for the user_id and IP so that it uses the actual current value for it.

Is there a table with these or somewhere I can have them for future reference? I can find no documentation on it.

Thanks!

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

13 years 9 months ago #151028 by laptoproadie
Replied by laptoproadie on topic Re: CB Query
I found this:

www.allmysocials.com/tutorials/item/233-substitution-usage

Which is working for user_id, but I want to also save the IP address of the user to the table. Can I use a placeholder that would be substituted for the IP address?

Why can't I use global variables within the Joomla framework as well, perhaps session variables in my queries?

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

Moderators: beatnantkrileon
Powered by Kunena Forum