mysql functions examples updated, closing connections not necessary, PSR-2