Is there a way to get the query process id that just issued by PHP mysqli_query or PDO?
$result = mysqli_query("SELECT * FROM table");
I'm not sure what you mean with "process id", but if you want to get the thread id of the currect mysql connection, you can do this with:
MySQLi Object orientated style:
/* MySQL thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id);
MySQLi procedural style:
/* MySQL thread id */ $thread_id = mysqli_thread_id($mysqli); /* Kill connection */ mysqli_kill($mysqli, $thread_id);
Using MySQL to get the thread ID in general:
$query = "SELECT CONNECTION_ID()";
It's not like every query has its own "process". Every connection has. As long as you don't close the connection, the thread id will remain the same for each query.