phpDocumentor SpoolTemplate
[ Back ] [ class tree: SpoolTemplate ] [ index: SpoolTemplate ] [ all elements ]

Source for file sptpl_db_mssql.php

Documentation is available at sptpl_db_mssql.php

  1. <?php
  2.  
  3. /**
  4. * sptpl_db_mssql.php
  5. *
  6. * MS SQL Server access module
  7. *
  8. * Requires: sptpl_db.php
  9. *
  10. * @copyright sptpl_db_mssql.php is part of Sptpl project {@link http://www.andrioli.com/en/sptpl.html} and it is LGPL
  11. * @author Andrioli Darvin <darvin (inside) andrioli (dot) com>
  12. * @version $Header: d:\cvs/classistd/sptpl/sptpl_db_mssql.php,v 2.1 2005/03/02 21:00:54 Darvin Exp $
  13. *
  14. */
  15. /*
  16. * +-------------------------------------------------------------------------+
  17. * | Sptpl |
  18. * +-------------------------------------------------------------------------+
  19. * | Copyright (c) 2003-2005 Andrioli Darvin |
  20. * | Email <darvin (inside) andrioli (dot) com> |
  21. * | Web http://www.andrioli.com/en/sptpl.html |
  22. * | Download http://www.phpclasses.org/browse.html/package/1326.html |
  23. * | |
  24. * +-------------------------------------------------------------------------+
  25. * | This library is free software; you can redistribute it and/or modify |
  26. * | it under the terms of the GNU Lesser General Public License as |
  27. * | published by the Free Software Foundation; either version 2 of the |
  28. * | License, or (at your option) any later version. |
  29. * | |
  30. * | This library is distributed in the hope that it will be useful, but |
  31. * | WITHOUT ANY WARRANTY; without even the implied warranty of |
  32. * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
  33. * | Lesser General Public License for more details. |
  34. * | |
  35. * | You should have received a copy of the GNU Lesser General Public |
  36. * | License along with this library; if not, write to the Free Software |
  37. * | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
  38. * +-------------------------------------------------------------------------+
  39. */
  40.  
  41.  
  42. class db_mssql extends CDB {
  43.  
  44. function db_mssql()
  45. {
  46.  
  47. }
  48.  
  49. function DbOpen($DBSystem,$DBUser,$DBPasswd,$DBName)
  50. {
  51. if(($this->DbConn=mysql_connect($DBSystem,$DBUser,$DBPasswd))===FALSE)
  52. {
  53. // Errore di select del db
  54. trigger_error("Error during connection to the server ".$DBSystem,E_USER_ERROR);
  55. }
  56. if(!mssql_select_db($DBName,$this->DbConn))
  57. {
  58. // Errore di select del db
  59. trigger_error("I cannot select the db ".$DBName,E_USER_ERROR);
  60. }
  61. }
  62. function DbExecSql($sql)
  63. {
  64. if(($this->DbResult=mssql_query($sql))===FALSE)
  65. {
  66. // Errore di select del db
  67. trigger_error("Error into sql statement. Sql string: ".$sql,E_USER_ERROR);
  68. }
  69. // ToTrace($sql);
  70. return(TRUE);
  71. }
  72.  
  73. function DbGetValue()
  74. {
  75. // ToTrace("Prima ".$GLOBALS['debug']->Dump($this->DbValue));
  76. return(mssql_fetch_array($this->DbResult));
  77. // ToTrace("Dopo ".$GLOBALS['debug']->Dump($this->DbValue));
  78. // MyDebug(mysql_fetch_array($this->DbResult));
  79.  
  80. }
  81. function DbClose()
  82. {
  83. mssql_close($this->DbConn);
  84. }
  85. }
  86.  
  87. ?>

Documentation generated on Mon, 28 Mar 2005 15:13:22 +0200 by phpDocumentor 1.3.0RC3