New issue
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
Affected Row ID #1
Comments
Sorry I let this go for so long, been busy on other projects. Plus I use CodeIgniter so I rarely use standalone db libraries like this except for in small projects. In answer to your question yes. This is actually what I'm doing now with the following code located on line 170 of the insert method. ($stmt->affected_rows) ? $result = $stmt->insert_id : $result = false; So IF there are affected rows then return the inserted id, IF not then return false. The included index file shows an example of inserting a record then prints out the inserted ID. |
Calling reset should set values to null instead of unsetting them
I was just wondering how I might be able to adjust this class so when I INSERT something, the class returns something like the affected_row_id. In other words is it possible to add mysql_insert_id() functionality into the class?
It would be incredibly handy to know the generated row ID when inserting new data.
The text was updated successfully, but these errors were encountered: