Hi, I am planning to use a Master Slave setup in MySQL database. My concern is can I use the "mysql_insert_id()" function to get the recently inserted ID? Does it uses the "Select" query to get the latest inserted ID?
In that case my query may fail because, the insert query will be fired at master DB, but the select to slave DB. And there may be some delay in the replication.
Need help ..
mysql_insert_id in a Master Slave setup
Moderator: General Moderators
Re: mysql_insert_id in a Master Slave setup
yes, it will work if you call mysql_insert_id() right after execution of the statement and if you use the same connection resource because the id is maintained for each single connection.