Subversion Repositories php_guestbook

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. function verbinden() {
  4.         global $mysql_database, $mysql_server, $mysql_pass, $mysql_user;
  5.         global $link2;
  6.  
  7.         $link2 = mysql_connect($mysql_server, $mysql_user, $mysql_pass);
  8.         if (!$link2) {
  9.                 die('<b>Verbindung zum MySQL-Server konnte nicht hergestellt werden! ('.mysql_error().')</b>');
  10.         }
  11.  
  12.         if (!mysql_select_db($mysql_database)) {
  13.                 die('<b>Verbindung zum MySQL-Server konnte nicht hergestellt werden! ('.mysql_error().')</b>');
  14.         }
  15.  
  16.         register_shutdown_function('trennen');
  17.         mysql_select_db($mysql_database);
  18. }
  19.  
  20. function trennen() {
  21.         global $link2;
  22.         @mysql_close($link2);
  23. }
  24.  
  25. ?>
  26.