Joy
(@joyously)
The $user_id would be the ID of the user’s record in the user table.
The $meta_key is what you are calling this data, such as ‘theUserNumber’.
The $meta_value is the actual number, such as 0.
The $unique is true or false depending on whether there are more than one of these per user.
Thanks for your reply @joyously
And I’m sorry, I’m only trying to learn because I’m new to php
What I’m trying to say is that $user-id is meant to be for all user not for one user, how do I do that?
Joy
(@joyously)
User meta is for storing something per user. If you want to store a single number that is counting users, then you wouldn’t store it in user meta. And if it’s counting, it’s better to just ask the database how many there are when you need it.
For a single number, you can create an option, instead of user meta.