Get the user ID

I have an app where I need the id from the users table instead of the user_id. How do I make the call in the constructor?
Currently, by calling user_id, I automatically retrieve it, but I actually need the id so that in case the username changes, I don’t lose control over it.

The userId doesn’t change. Afaik.

And if the user change the name in his space ?

The user id is not changeable, not even by the admin.

The user name in human readable form is for sure but this is not the user_id.

For example in this table the id and the user_id is always the same ?

| id | user_id | status  | status_timestamp | is_user_defined | message_id | custom_icon | custom_message | clear_at | is_backup | status_message_timestamp |
+----+---------+---------+------------------+-----------------+------------+-------------+----------------+----------+-----------+--------------------------+
|  1 | admin   | online  |       1726818190 |               0 | NULL       | NULL        | NULL           |     NULL |         0 |               1719921468 |
|  4 | new     | offline |       1726757878 |               0 | NULL       | NULL        | NULL           |     NULL |         0 |                        0 |
+----+---------+---------+------------------+-----------------+------------+-------------+----------------+----------+--

Ahhh, I do not understand this actually, sorry.

The table has primary keys (that are numeric auto incrementing values in id) and the acutal user id (called user_id which is a string the admin can select at user creation).

So, what should be the same, please explain to me. I might be a bit slow today, still very tired.