Forum Moderators: coopster

Message Too Old, No Replies

Stop mysql query if too long. Is it possible?

         

cameraguy

8:20 am on Sep 22, 2006 (gmt 0)

10+ Year Member



Hello,

I have a flash movie that queries a table thourgh a php script. There are times when apparently the query is too long (>15 seconds) and that generates an fatal error in my flash movie.

Is there a way to interrupt a mysql query if it becomes too long?

Thank you!

barns101

11:08 am on Sep 22, 2006 (gmt 0)

10+ Year Member



I'm not sure about interrupting your query, but you could probably optimise your database and/or SQL statement to speed up queries.

coopster

2:05 pm on Sep 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Right on, look at optimizing that query first.
You can also tell the server to allow your script to run longer (see set_time_limit() [php.net]) but optimizing that query is your first and foremost issue.

cameraguy

10:03 pm on Sep 22, 2006 (gmt 0)

10+ Year Member



Thank you guys. The query is optimized. I think I need to look for the cause somewhere else.