Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

pdo connexion

public static function connexionBDD()
    {
        $base = null;

        try {
            $base = new PDO('mysql:host=' . MYSQL_HOSTNAME . '; dbname=' . MYSQL_DATABASE . '', MYSQL_USERNAME, MYSQL_PASSWORD);
        } catch (exception $e) {
            die('Erreur ' . $e->getMessage());
        }

        return $base;
    }
 
PREVIOUS NEXT
Tagged: #pdo #connexion
ADD COMMENT
Topic
Name
5+5 =