public int getPQLog(String pqid) {
        Connection con1 = DatabaseConnection.getConnection();
        try {
            int ret_count = 0;
            PreparedStatement ps;
            ps = con1.prepareStatement("SELECT COUNT(*) FROM pqlog WHERE charid = ? and pqid = ? and lastattempt >= subtime(current_timestamp, '1 0:0:0.0')");
            ps.setInt(1, id);
            ps.setString(2, pqid);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                ret_count = rs.getInt(1);
            } else {
                ret_count = -1;
            }
            rs.close();
            ps.close();
            return ret_count;
        } catch (Exception Ex) {
            return -1;
        }
    }

//    public int getGiftLog(String pqid) {
//        Connection con1 = DatabaseConnection.getConnection();
//        try {
//            int ret_count = 0;
//            PreparedStatement ps;
//            ps = con1.prepareStatement("select count(*) from pqlog where accountid = ? and pqid = ? and lastattempt >= subtime(current_timestamp, '1 0:0:0.0')");
//            ps.setInt(1, accountid);
//            ps.setString(2, pqid);
//            ResultSet rs = ps.executeQuery();
//            if (rs.next()) 
//                ret_count = rs.getInt(1);
//            else
//                ret_count = -1;
//            rs.close();
//            ps.close();
//            return ret_count;
//        } catch (Exception Ex) {
//            return -1;
//        }
//    }