Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. $mysqli = new mysqli("localhost", "root", "admin", "base");
  3.  
  4. /* Comprueba la conexión */
  5. if ($mysqli->connect_errno) {
  6. printf("Connect failed: %sn", $mysqli->connect_error);
  7. exit();
  8. }
  9.  
  10. if (!$mysqli->query("SET a=1")) {
  11. printf("Errormessage: %sn", $mysqli->error);
  12. }
  13.  
  14. /* Cierra la conexión */
  15. $mysqli->close();
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement