public function selectValue($sql, $arg1 = null, $arg2 = null) { $stmt = $this->execute($sql, $arg1, $arg2); if (!$stmt) { return null; } $result = $stmt->fetchColumn(0); // Required to really close the connection. $stmt = null; return $result; }