replaced code calling mysql_query() with execSql() to make source code simple.