Returns the connection ID (thread ID) for the connection. Every connection has an ID that is unique among the set of currently connected clients.
Returns the user name and host name combination for the MySQL account that the server used to authenticate the current client. This account determines your access privileges. The return value is a string in the utf8character set.
Returns the default (current) database name as a string in the utf8 character set. If there is no default database,DATABASE() returns NULL.
Returns the current MySQL user name and host name as a string in the utf8 character set.
Returns a string that indicates the MySQL server version. The string uses the utf8 character set.
SELECT CONNECTION_ID(); SELECT CURRENT_USER(); SELECT DATABASE(); SELECT USER(); SELECT VERSION();
A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:
SELECT SQL_CALC_FOUND_ROWS emp_no, first_name FROM employees LIMIT 4; SELECT FOUND_ROWS();
Returns the number of rows changed, deleted, or inserted by the last statement if it was an UPDATE, DELETE, or INSERT.
Value of the AUTOINCREMENT column for the last INSERT.
Tags: mysql CONNECTION_ID function, mysql CURRENT_USER() function, mysql DATABASE() function, mysql found_rows() function, mysql LAST_INSERT_ID() function, mysql row_count() function, mysql SQL_CALC_FOUND_ROWS, mysql user() function, mysql version() function