Advertisement
Guest User

Untitled

a guest
May 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. $link = mysqli_connect("localhost", "my_user", "my_password", "world");
  3.  
  4. /* controllo connection */
  5. if (mysqli_connect_errno()) {
  6.     printf("Connessione fallita : %s\n", mysqli_connect_error());
  7.     exit();
  8. }
  9.  
  10. /* controllo se il server mysql è avviato*/
  11. if (mysqli_ping($link)) {
  12.     printf ("Server mysql ok!\n");
  13. } else {
  14.     printf ("Errore: %s\n", mysqli_error($link));
  15. }
  16.  
  17. /* chiudo connessione */
  18. mysqli_close($link);
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement