Page 1 of 1

Retrieving records (mysql)

Posted: Tue Feb 12, 2008 6:45 pm
by Skillkeeper
My problem 8O

INSERT INTO `blabla` (aaa,bbb,ccc etc...) VALUES('aaa','bbb','ccc' etc...);

Next I query the database for the record that was just added above

SELECT * FROM `blabla` WHERE aaa = 'aaa';

The record is not being returned (fields are all NULL)

I run the query again (sometimes 2 to 3 times) and finally I get my record.

Looks to me like the server is too busy to add the record fast enough or what.
How do I get my record?

Re: Retrieving records (mysql)

Posted: Tue Feb 12, 2008 6:57 pm
by Benjamin
If the select queries being routed to a slave server there can be a delay. If you need to query data you have just inserted, you'll need to route the select query to the master server.