I had a look at your source code real nice; would like to suggest one thing though, that mysql connection may time out, you will need to check if it has?