« Programmation PHP/PDO » : différence entre les versions

Contenu supprimé Contenu ajouté
DannyS712 (discussion | contributions)
m <source> -> <syntaxhighlight> (phab:T237267)
Ligne 49 :
* Pour MySQL<ref>http://php.net/manual/fr/ref.pdo-mysql.php</ref> :
<syntaxhighlight lang="PHP">
$connexion = new PDO('mysql:host=mon_serveur;dbname=ma_bd;port=mon_port3306','mon_id','mon_mot_de_passe');
</syntaxhighlight>
* Pour MS-SQL<ref>http://php.net/manual/fr/ref.pdo-sqlsrv.connection.php</ref> les noms des paramètres diffèrent :
Ligne 58 :
<syntaxhighlight lang="PHP">
$connexion = new PDO('odbc:nom_de_la_source','mon_id','mon_mot_de_passe');
</syntaxhighlight>
* Pour PostgreSQL<ref>https://www.php.net/manual/fr/ref.pdo-pgsql.php</ref> :
<syntaxhighlight lang="PHP">
$connexion = new PDO('pgsql:host=mon_serveur;dbname=ma_bd;port=5432';user='mon_id';password='mon_mot_de_passe');
</syntaxhighlight>