Retrieving records (mysql)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Skillkeeper
Forum Newbie
Posts: 1
Joined: Tue Feb 12, 2008 6:35 pm

Retrieving records (mysql)

Post 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?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Retrieving records (mysql)

Post 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.
Post Reply