Returns the username and hostname of the current MySQL connection.
VARCHARDiperbarui: 13 Jun 2026USER()Fungsi ini tidak memerlukan parameter.
1 SELECT USER() AS connected_user;
Display the currently connected user.
1 INSERT INTO changes_log (changed_by, table_name, action) 2 VALUES (USER(), 'customers', 'UPDATE');
Record who made a change in the audit log.
1 SELECT USER() AS session_user, 2 CURRENT_USER() AS auth_user;
Compare the session user against the authenticated user.
Sudah paham USER? Latih langsung di browser
Latihan interaktif, langsung di browser.