I was wondering if there's such thing as the equivalent as a callback function using mysql after an INSERT or UPDATE which could return me the row # and maybe values of such rows.
You can create triggers that are called on insert and update. They do not return value, but they can set variables you can read outside them.
I am not aware of any callback as you say but surely from your calling application you can retrieve the last inserted ID in case you did not specify it and the db has generated an auto increment value. Other values you should already know because you have inserted them.
if you need to know those values within the database server, you can have a SQL trigger which is executed at every insert so you can do more processing on the newly inserted record, for example write something in another table etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With