I apologize in advance. I don't know even how to ask, what to ask, or what search for.

Let say users can access my website from different URLs.


How can I those "something" save into DB? Or another way to store those "something" variables.

I want have overview of all attempts to access my website.

What can I do? Any ideas?

  1. If you have simple data, you can use add_option function to save the data to the wp_options database table. You can pass an array, it will be serialized automatically. Just pass the array to the function in the second argument, and specify the option name in the first argument (something like all_visits).

    And then you can retrieve it later using get_option function — just pass option name (in our case, all_visits) as the first argument. The value will be retrieved from the wp_options database table and unserialized automatically.

  2. If you want to save complex data, take a look at the wpdb class — it contains a set of functions used to interact with a database.

  • Thank you for your suggestion!
    – Jozef P.
    Jul 31 '19 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.