try{
$stmt = $conn->prepare($query);
$stmt->execute($exec_arr);
} catch(PDOException $e) {
if($e->getCode() == 23000){
array_push($errors, 'Technology already exists');
} else {
array_push($errors, 'Database error');
}
}