Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ClassesConfig;
- use PDO;
- class Connection {
- public static function getConnection() {
- $dbhost = "algumhost";
- $dbuser = "algumuser";
- $dbpass = "algumasenha";
- $dbname = "algumabase";
- $dbms = "algumsgbd";
- $dbport = "9999";
- $dsn = "$dbms:host=$dbhost;port=$dbport;dbname=$dbname;user=$dbuser;password=$dbpass";
- try {
- $dblink = new PDO ( $dsn );
- $dblink->setAttribute ( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- } catch ( PDOException $e ) {
- echo 'Erro na conexão: ' . $e->getMessage();
- }
- return $dblink;
- }
- }
- Fatal error: Class 'ClassesPDO' not found in path/para/meuarquivo.php on line 69
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement