Source for file database.php

Documentation is available at database.php

  1. <?
  2. /**
  3. * database.php
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * @author Stephan Raabe
  14. */
  15.  
  16. /**
  17. * returns a database connection
  18. * @return resource
  19. */
  20. function connectDB()
  21. {
  22. global $db_server, $db_user, $db_password, $db_name;
  23. $link = mysql_pconnect($db_server, $db_user, $db_password) or die("<script language='Javascript'>location.href='installation/index.php';</script>");
  24. mysql_select_db($db_name) or die("<script language='Javascript'>location.href='installation/index.php';</script>");
  25. return $link;
  26. }
  27.  
  28. /**
  29. * returns the filename of a path
  30. */
  31. function closeDB($link)
  32. {
  33. mysql_close($link);
  34. }
  35. ?>

Documentation generated on Tue, 04 Oct 2005 11:13:38 +0200 by phpDocumentor 1.3.0RC3