fixed db connection bug in mysql and mysqli