Why UPDATE times out?

They have: 12 posts

Joined: Feb 2004

Hi,

This works fine:

SELECT * FROM mytable
where fIndex = '12345'

But this times out:

UPDATE mytable
SET fEmail = '[email protected]'
WHERE fIndex = '12345'

Any ideas? fIndex is indexed and I also added an index to fEmail.

Find your Old Flames at MyOldFlames.com

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Have you tried executing the query from a command prompt?
If your using PHP to run the query, have you tried echoing mysql_error()?
Does your mysql user have permissions to perform an UPDATE query?

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 12 posts

Joined: Feb 2004

Hi Mark,

Yes I tried executing from SQLConsole and it ran fine. It took me most of the night but I found out in the end: just before the code above I opened the same record into Recordset1 but didn't close Recordset1 till after the code above so the row was locked out when the code tried to update it.

D'oh!

Find your Old Flames at MyOldFlames.com

druagord's picture

He has: 335 posts

Joined: May 2003

oh that ASP hum

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.