CB Query

13 years 3 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 to join the conversation.

13 years 3 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.153 seconds