adodb-mssqlpo.inc.php 1.5 KB

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