We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to get the last insert id. But I am using it in pool mode, will it affect the result by other inserts?
$resultSet = yield $pool->prepare("INSERT INTO `table` (`data`) VALUE (:data)", ['data' => $data]); $insertId= $resultSet->getConnInfo()->insertId;
Is it the correct code to get the insertId?
The text was updated successfully, but these errors were encountered:
You don't get a ResultSet for insert queries. You can use the following snippet, it resolves to a connection info object.
ResultSet
$info = yield $conn->prepare( "INSERT INTO bugs (title, data, submitter) " . "VALUES (:title, :data, :submitter)", ["title" => $title, "data" => $data, "submitter" => $uid] ); $id = $info->insertId;
Sorry, something went wrong.
No branches or pull requests
I am trying to get the last insert id. But I am using it in pool mode, will it affect the result by other inserts?
Is it the correct code to get the insertId?
The text was updated successfully, but these errors were encountered: