adodb-mssqlpo.inc.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @version v5.20.17 31-Mar-2020
  4. * @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
  5. * @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
  6. * Released under both BSD license and Lesser GPL library license.
  7. * Whenever there is any discrepancy between the two licenses,
  8. * the BSD license will take precedence.
  9. *
  10. * Set tabs to 4 for best viewing.
  11. *
  12. * Latest version is available at http://adodb.org/
  13. *
  14. * Portable MSSQL Driver that supports || instead of +
  15. *
  16. */
  17. // security - hide paths
  18. if (!defined('ADODB_DIR')) die();
  19. /*
  20. The big difference between mssqlpo and it's parent mssql is that mssqlpo supports
  21. the more standard || string concatenation operator.
  22. */
  23. include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php');
  24. class ADODB_mssqlpo extends ADODB_mssql {
  25. var $databaseType = "mssqlpo";
  26. var $concat_operator = '||';
  27. function PrepareSP($sql, $param = true)
  28. {
  29. if (!$this->_has_mssql_init) {
  30. ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
  31. return $sql;
  32. }
  33. if (is_string($sql)) $sql = str_replace('||','+',$sql);
  34. $stmt = mssql_init($sql,$this->_connectionID);
  35. if (!$stmt) return $sql;
  36. return array($sql,$stmt);
  37. }
  38. function _query($sql,$inputarr=false)
  39. {
  40. if (is_string($sql)) $sql = str_replace('||','+',$sql);
  41. return ADODB_mssql::_query($sql,$inputarr);
  42. }
  43. }
  44. class ADORecordset_mssqlpo extends ADORecordset_mssql {
  45. var $databaseType = "mssqlpo";
  46. function __construct($id,$mode=false)
  47. {
  48. parent::__construct($id,$mode);
  49. }
  50. }