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. * @package generator
  14. * @author Stephan Raabe
  15. */
  16.  
  17. /**
  18. * returns a database connection
  19. * @return resource
  20. */
  21. function connectDB()
  22. {
  23. global $db_server, $db_user, $db_password, $db_name;
  24. $link = mysql_pconnect($db_server, $db_user, $db_password) or die("<script language='Javascript'>location.href='installation/index.php';</script>");
  25. mysql_select_db($db_name) or die("<script language='Javascript'>location.href='installation/index.php';</script>");
  26. return $link;
  27. }
  28.  
  29. /**
  30. * returns the filename of a path
  31. */
  32. function closeDB($link)
  33. {
  34. mysql_close($link);
  35. }
  36. ?>

Documentation generated on Tue, 16 Aug 2005 17:28:45 +0200 by phpDocumentor 1.3.0RC3