Returns the connection ID (thread ID) for the current connection.
BIGINT UNSIGNEDDiperbarui: 13 Jun 2026CONNECTION_ID()Fungsi ini tidak memerlukan parameter.
1 SELECT CONNECTION_ID() AS my_conn_id;
Retrieve the current connection ID.
1 INSERT INTO debug_log (connection_id, query, logged_at) 2 VALUES (CONNECTION_ID(), 'SELECT * FROM users', NOW());
Log entries with the connection ID for debugging.
1 SELECT * FROM information_schema.PROCESSLIST 2 WHERE ID = CONNECTION_ID();
View information about the current connection process.
Sudah paham CONNECTION_ID? Latih langsung di browser
Latihan interaktif, langsung di browser.