preparing queries for pdo check