registerTicket works with SQL