| name | language | licence |
|---|---|---|
| PHP/MYSQL : utilisation orientée objet de mysqli | Other | Other |
| PHP/MYSQL : recuperer un date en base et la formater grace à date | PHP | Other |
| PHP/MYSQL : usage procedurale de mysqli | PHP | Other |
| PHP/MYSQL : Notes mysqli | PHP | Other |
| PHP/MYSQL : Chaines de caractères echapper avant insertion en base | PHP | Other |
| PHP/MYSQL/SQL : inserer donnees en base depuis csv | PHP | Other |
| PHP/JS : ternaire | PHP | Other |
| PHP/JS : utilisation de la classe Ajax_upload | Other | Other |
< 1 2 3 4 5 >
language: Other
licence: Other
PHP/MYSQL : utilisation orientée objet de mysqli
options: view full snippet • send to code collector
<?php
/* how to create connexion (4th parameter = default database) */
$mysqli = new mysqli($host, $usr, $pass, $db);
/* how to verify connexion */
if (mysqli_connect_errno()) {
printf("Echec de la connexion : %s\n", mysqli_connect_error());
}
/* how to set the default charset to use */
if (!$mysqli->set_charset("utf8")) {
printf("Erreur lors du chargement du jeu de caractères utf8 : %s\n", $mysqli->error);
}



library
html (48)