Архив рубрики: MySql

View MySql log online

mysql -u username -p password SET GLOBAL general_log = ‘ON’; SHOW VARIABLES LIKE «general_log%»; tail -f /var/lib/mysql/localhost.log

Last_Id

$selectquery=»SELECT id FROM table ORDER BY id DESC LIMIT 1″; $result = $mysqli->query($selectquery); $row = $result->fetch_assoc(); echo $row[‘id’];