当前位置: 首页>>代码示例>>PHP>>正文


PHP adodb_addslashes函数代码示例

本文整理汇总了PHP中adodb_addslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP adodb_addslashes函数的具体用法?PHP adodb_addslashes怎么用?PHP adodb_addslashes使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了adodb_addslashes函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _connect

 function _connect($str, $user = '', $pwd = '', $db = '', $ctype = 0)
 {
     if (!function_exists('pg_connect')) {
         return null;
     }
     $this->_errorMsg = false;
     if ($user || $pwd || $db) {
         $user = adodb_addslashes($user);
         $pwd = adodb_addslashes($pwd);
         if (strlen($db) == 0) {
             $db = 'template1';
         }
         $db = adodb_addslashes($db);
         if ($str) {
             $host = split(":", $str);
             if ($host[0]) {
                 $str = "host=" . adodb_addslashes($host[0]);
             } else {
                 $str = '';
             }
             if (isset($host[1])) {
                 $str .= " port={$host['1']}";
             } else {
                 if (!empty($this->port)) {
                     $str .= " port=" . $this->port;
                 }
             }
         }
         if ($user) {
             $str .= " user=" . $user;
         }
         if ($pwd) {
             $str .= " password=" . $pwd;
         }
         if ($db) {
             $str .= " dbname=" . $db;
         }
     }
     //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
     if ($ctype === 1) {
         // persistent
         $this->_connectionID = pg_pconnect($str);
     } else {
         if ($ctype === -1) {
             // nconnect, we trick pgsql ext by changing the connection str
             static $ncnt;
             if (empty($ncnt)) {
                 $ncnt = 1;
             } else {
                 $ncnt += 1;
             }
             $str .= str_repeat(' ', $ncnt);
         }
         $this->_connectionID = pg_connect($str);
     }
     if ($this->_connectionID === false) {
         return false;
     }
     $this->Execute("set datestyle='ISO'");
     $info = $this->ServerInfo();
     $this->pgVersion = (double) substr($info['version'], 0, 3);
     if ($this->pgVersion >= 7.1) {
         // good till version 999
         $this->_nestedSQL = true;
     }
     return true;
 }
开发者ID:dasatti,项目名称:dashboard,代码行数:67,代码来源:adodb-postgres64.inc.php

示例2: _connect

 function _connect($str, $user = '', $pwd = '', $db = '', $persist = false)
 {
     if ($user || $pwd || $db) {
         $str = adodb_addslashes($str);
         $user = adodb_addslashes($user);
         $pwd = adodb_addslashes($pwd);
         $db = adodb_addslashes($db);
         if ($str) {
             $host = split(":", $str);
             if ($host[0]) {
                 $str = "host={$host['0']}";
             } else {
                 $str = 'localhost';
             }
             if (isset($host[1])) {
                 $str .= " port={$host['1']}";
             }
         }
         if ($user) {
             $str .= " user=" . $user;
         }
         if ($pwd) {
             $str .= " password=" . $pwd;
         }
         if ($db) {
             $str .= " dbname=" . $db;
         }
     }
     //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
     if ($persist) {
         $this->_connectionID = pg_pconnect($str);
     } else {
         $this->_connectionID = pg_connect($str);
     }
     if ($this->_connectionID === false) {
         return false;
     }
     $this->Execute("set datestyle='ISO'");
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:osiswebprinter,代码行数:40,代码来源:adodb-postgres64.inc.php

示例3: _connect

 function _connect($str, $user = '', $pwd = '', $db = '', $ctype = 0)
 {
     if (!function_exists('pg_pconnect')) {
         return false;
     }
     $this->_errorMsg = false;
     if ($user || $pwd || $db) {
         $user = adodb_addslashes($user);
         $pwd = adodb_addslashes($pwd);
         if (strlen($db) == 0) {
             $db = 'template1';
         }
         $db = adodb_addslashes($db);
         if ($str) {
             $host = explode(":", $str);
             if ($host[0]) {
                 $str = "host=" . adodb_addslashes($host[0]);
             } else {
                 $str = 'host=localhost';
             }
             if (isset($host[1])) {
                 $str .= " port={$host['1']}";
             }
         }
         if ($user) {
             $str .= " user=" . $user;
         }
         if ($pwd) {
             $str .= " password=" . $pwd;
         }
         if ($db) {
             $str .= " dbname=" . $db;
         }
     }
     //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
     if ($ctype === 1) {
         // persistent
         $this->_connectionID = pg_pconnect($str);
     } else {
         if ($ctype === -1) {
             // nconnect, we trick pgsql ext by changing the connection str
             static $ncnt;
             if (empty($ncnt)) {
                 $ncnt = 1;
             } else {
                 $ncnt += 1;
             }
             $str .= str_repeat(' ', $ncnt);
         }
         $this->_connectionID = pg_connect($str);
     }
     if ($this->_connectionID === false) {
         return false;
     }
     $this->Execute("set datestyle='ISO'");
     return true;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:57,代码来源:adodb-postgres64.inc.php

示例4: _connect

 function _connect($str, $user = '', $pwd = '', $db = '', $ctype = 0)
 {
     if (!function_exists('pg_connect')) {
         return null;
     }
     $this->_errorMsg = false;
     if ($user || $pwd || $db) {
         $user = adodb_addslashes($user);
         $pwd = adodb_addslashes($pwd);
         if (strlen($db) == 0) {
             $db = 'template1';
         }
         $db = adodb_addslashes($db);
         if ($str) {
             $host = explode(":", $str);
             if ($host[0]) {
                 $str = "host=" . adodb_addslashes($host[0]);
             } else {
                 $str = '';
             }
             if (isset($host[1])) {
                 $str .= " port={$host['1']}";
             } else {
                 if (!empty($this->port)) {
                     $str .= " port=" . $this->port;
                 }
             }
         }
         if ($user) {
             $str .= " user=" . $user;
         }
         if ($pwd) {
             $str .= " password=" . $pwd;
         }
         if ($db) {
             $str .= " dbname=" . $db;
         }
     }
     //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
     if ($ctype === 1) {
         // persistent
         $this->_connectionID = pg_pconnect($str);
     } else {
         if ($ctype === -1) {
             // nconnect, we trick pgsql ext by changing the connection str
             static $ncnt;
             if (empty($ncnt)) {
                 $ncnt = 1;
             } else {
                 $ncnt += 1;
             }
             $str .= str_repeat(' ', $ncnt);
         }
         $this->_connectionID = pg_connect($str);
     }
     if ($this->_connectionID === false) {
         return false;
     }
     $this->Execute("set datestyle='ISO'");
     $info = $this->ServerInfo();
     $this->pgVersion = (double) substr($info['version'], 0, 3);
     if ($this->pgVersion >= 7.1) {
         // good till version 999
         $this->_nestedSQL = true;
     }
     # PostgreSQL 9.0 changed the default output for bytea from 'escape' to 'hex'
     # PHP does not handle 'hex' properly ('x74657374' is returned as 't657374')
     # https://bugs.php.net/bug.php?id=59831 states this is in fact not a bug,
     # so we manually set bytea_output
     if (!empty($this->connection->noBlobs) && version_compare($info['version'], '9.0', '>=')) {
         $this->Execute('set bytea_output=escape');
     }
     return true;
 }
开发者ID:nicolas34732,项目名称:address_book,代码行数:74,代码来源:adodb-postgres64.inc.php

示例5: _connect

 function _connect($str, $user = '', $pwd = '', $db = '', $ctype = 0)
 {
     if (!function_exists('pg_connect')) {
         return null;
     }
     $this->_errorMsg = false;
     if ($user || $pwd || $db) {
         $user = adodb_addslashes($user);
         $pwd = adodb_addslashes($pwd);
         if (strlen($db) == 0) {
             $db = 'template1';
         }
         $db = adodb_addslashes($db);
         if ($str) {
             $host = split(":", $str);
             if ($host[0]) {
                 $str = "host=" . adodb_addslashes($host[0]);
             } else {
                 $str = 'host=';
             }
             // Modified 2004-07-23 by Kevin Jamieson (http://pkp.sfu.ca/)
             // Don't specify a host if none was entered (so will connect using sockets)
             if (isset($host[1])) {
                 $str .= " port={$host['1']}";
             } else {
                 if (!empty($this->port)) {
                     $str .= " port=" . $this->port;
                 }
             }
         }
         if ($user) {
             $str .= " user=" . $user;
         }
         if ($pwd) {
             $str .= " password=" . $pwd;
         }
         if ($db) {
             $str .= " dbname=" . $db;
         }
     }
     //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
     if ($ctype === 1) {
         // persistent
         $this->_connectionID = pg_pconnect($str);
     } else {
         if ($ctype === -1) {
             // nconnect, we trick pgsql ext by changing the connection str
             static $ncnt;
             if (empty($ncnt)) {
                 $ncnt = 1;
             } else {
                 $ncnt += 1;
             }
             $str .= str_repeat(' ', $ncnt);
         }
         $this->_connectionID = pg_connect($str);
     }
     if ($this->_connectionID === false) {
         return false;
     }
     $this->Execute("set datestyle='ISO'");
     return true;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:63,代码来源:adodb-postgres64.inc.php


注:本文中的adodb_addslashes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。