How to timeout queries that are taking to long

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Is there a way with php/mysql to have a set timeout period for
queries.  My hosting provider is complaining about to many processes
when my pages connect to my db.  Sometimes they take a few minutes to
complete and I want to just stop anything that is taking more than
30 secs.  Is there a way to do this. The php execution time is set to
30 secs. I thought that would do it but isn't.  The mysql server is on
another system from the php server also if that helps.

Site Timeline