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


PHP sqlite_libencoding函数代码示例

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


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

示例1: dl

<?php

if (!extension_loaded("sqlite")) {
    dl("sqlite.so");
    if (!extension_loaded("sqlite")) {
        exit("Please enable SQLite support\n");
    }
}
debug_zval_dump(sqlite_libversion());
debug_zval_dump(sqlite_libencoding());
$s = sqlite_open("weztest.sqlite", 0666, $err);
debug_zval_dump($err);
debug_zval_dump($s);
$r = sqlite_query("create table foo (a INTEGER PRIMARY KEY, b INTEGER )", $s);
debug_zval_dump(sqlite_last_error($s));
debug_zval_dump(sqlite_error_string(sqlite_last_error($s)));
$r = sqlite_query("select *, php('md5', sql) as o from sqlite_master", $s);
debug_zval_dump($r);
debug_zval_dump(sqlite_num_rows($r));
debug_zval_dump(sqlite_num_fields($r));
for ($j = 0; $j < sqlite_num_fields($r); $j++) {
    echo "Field {$j} is " . sqlite_field_name($r, $j) . "\n";
}
while ($row = sqlite_fetch_array($r, SQLITE_ASSOC)) {
    print_r($row);
}
sqlite_close($s);
开发者ID:garybulin,项目名称:php7,代码行数:27,代码来源:sqlite.php

示例2: ServerInfo

 function ServerInfo()
 {
     $arr['version'] = sqlite_libversion();
     $arr['description'] = 'SQLite ';
     $arr['encoding'] = sqlite_libencoding();
     return $arr;
 }
开发者ID:teddywen,项目名称:cacti,代码行数:7,代码来源:adodb-sqlite.inc.php

示例3: getAttribute

 public function getAttribute($attribute)
 {
     switch ($attribute) {
         case DoLite::ATTR_SERVER_INFO:
             return sqlite_libencoding();
             break;
         case DoLite::ATTR_SERVER_VERSION:
         case DoLite::ATTR_CLIENT_VERSION:
             return sqlite_libversion();
             break;
         case DoLite::ATTR_PERSISTENT:
             return $this->_persistent;
             break;
     }
     return null;
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:16,代码来源:DoSqlite.php

示例4: encoding

 /**
  * Renvoie le jeu de caractères courant utilisé.
  * Si l'argument $encoding est fourni, il est utilisé pour définir
  * le nouveau jeu de caractères de la connexion en cours
  * 
  * @param string $encoding
  * 
  * @access public
  * @return string
  */
 function encoding($encoding = null)
 {
     if (!is_null($encoding)) {
         trigger_error("Setting encoding isn't supported by SQLite", E_USER_WARNING);
     }
     return sqlite_libencoding();
 }
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:17,代码来源:sqlite.php

示例5: sqlitem_libencoding

function sqlitem_libencoding()
{
    die('sqlitem_libencoding not implemented in PDO');
    return sqlite_libencoding();
}
开发者ID:jaketay,项目名称:raspberry_pi,代码行数:5,代码来源:sqlite3.inc.php

示例6: createSQLiteFunctions

 /**
  * Adds a number of math functions to SQLite that MSSQL, MySQL and PostgreSQL have by default
  * 
  * @return void
  */
 private function createSQLiteFunctions()
 {
     $function = array();
     $functions[] = array('acos', 'acos', 1);
     $functions[] = array('asin', 'asin', 1);
     $functions[] = array('atan', 'atan', 1);
     $functions[] = array('atan2', 'atan2', 2);
     $functions[] = array('ceil', 'ceil', 1);
     $functions[] = array('ceiling', 'ceil', 1);
     $functions[] = array('cos', 'cos', 1);
     $functions[] = array('cot', array('fSQLTranslation', 'sqliteCotangent'), 1);
     $functions[] = array('degrees', 'rad2deg', 1);
     $functions[] = array('exp', 'exp', 1);
     $functions[] = array('floor', 'floor', 1);
     $functions[] = array('ln', 'log', 1);
     $functions[] = array('log', array('fSQLTranslation', 'sqliteLogBaseFirst'), 2);
     $functions[] = array('ltrim', 'ltrim', 1);
     $functions[] = array('pi', 'pi', 0);
     $functions[] = array('power', 'pow', 2);
     $functions[] = array('radians', 'deg2rad', 1);
     $functions[] = array('rtrim', 'rtrim', 1);
     $functions[] = array('sign', array('fSQLTranslation', 'sqliteSign'), 1);
     $functions[] = array('sqrt', 'sqrt', 1);
     $functions[] = array('sin', 'sin', 1);
     $functions[] = array('tan', 'tan', 1);
     $functions[] = array('trim', 'trim', 1);
     if ($this->database->getExtension() == 'sqlite') {
         $functions[] = array('current_date', array('fSQLTranslation', 'sqliteDate'), 0);
         $functions[] = array('current_time', array('fSQLTranslation', 'sqliteTime'), 0);
         $functions[] = array('current_timestamp', array('fSQLTranslation', 'sqliteTimestamp'), 0);
         // If SQLite was compiled with ISO-8859-* string handling, we override as best we can
         // with custom functions that return the correct values. We can't fix LIKE and GLOB
         // but they don't matter as much since the encoding only affects case transformations.
         if (strtolower(sqlite_libencoding()) != 'utf-8') {
             $functions[] = array('length', array('fSQLTranslation', 'sqliteLength'), 1);
             $functions[] = array('substr', array('fSQLTranslation', 'sqliteSubstr'), 3);
         }
     }
     foreach ($functions as $function) {
         if ($this->database->getExtension() == 'pdo') {
             $this->database->getConnection()->sqliteCreateFunction($function[0], $function[1], $function[2]);
         } else {
             sqlite_create_function($this->database->getConnection(), $function[0], $function[1], $function[2]);
         }
     }
 }
开发者ID:mrjwc,项目名称:printmaster,代码行数:51,代码来源:fSQLTranslation.php

示例7: sqlitem_libencoding

function sqlitem_libencoding()
{
    return sqlite_libencoding();
}
开发者ID:jaketay,项目名称:raspberry_pi,代码行数:4,代码来源:sqlite2.inc.php

示例8: getAttribute

 /**
  * Public method:
  *	Quotes correctly a string for this database
  *       	this->getAttribute( $attribute:Integer ):Mixed
  * @Param	Integer		a constant [	PDO_ATTR_SERVER_INFO,
  * 						PDO_ATTR_SERVER_VERSION,
  *                                              PDO_ATTR_CLIENT_VERSION,
  *                                              PDO_ATTR_PERSISTENT	]
  * @Return	Mixed		correct information or null
  */
 function getAttribute($attribute)
 {
     $result = null;
     switch ($attribute) {
         case PDO_ATTR_SERVER_INFO:
             $result = sqlite_libencoding();
             break;
         case PDO_ATTR_SERVER_VERSION:
         case PDO_ATTR_CLIENT_VERSION:
             $result = sqlite_libversion();
             break;
         case PDO_ATTR_PERSISTENT:
             $result = $this->__persistent;
             break;
     }
     return $result;
 }
开发者ID:D4rk4,项目名称:Kusaba-z,代码行数:27,代码来源:PDOStatement_sqlite.class.php

示例9: sqlite_libversion

 if ($view == "vacuum") {
     echo "class='tab_pressed'";
 } else {
     echo "class='tab'";
 }
 echo ">Vacuum</a>";
 echo "<div style='clear:both;'></div>";
 echo "<div id='main'>";
 if ($view == "structure") {
     echo "<b>Database name</b>: " . $db->getName() . "<br/>";
     echo "<b>Path to database</b>: " . $db->getPath() . "<br/>";
     echo "<b>Size of database</b>: " . $db->getSize() . "<br/>";
     echo "<b>Database last modified</b>: " . $db->getDate() . "<br/>";
     if ($db->getType() == "SQLiteDatabase") {
         echo "<b>SQLite version</b>: " . sqlite_libversion() . "<br/>";
         echo "<b>SQLite encoding</b>: " . sqlite_libencoding() . "<br/>";
     }
     if ($db->getType() == "SQLite3") {
         echo "<b>SQLite version</b>: " . SQLite3::version() . "<br/>";
     } else {
         echo "<b>SQLite version</b>: " . $db->getVersion() . "<br/>";
     }
     echo "<b>SQLite extension</b>: " . $db->getType() . "<br/>";
     echo "<b>PHP version</b>: " . phpversion() . "<br/><br/>";
     $query = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name";
     $result = $db->selectArray($query);
     $j = 0;
     for ($i = 0; $i < sizeof($result); $i++) {
         if (substr($result[$i]['name'], 0, 7) != "sqlite_" && $result[$i]['name'] != "") {
             $j++;
         }
开发者ID:rogeriopradoj,项目名称:phpliteadmin,代码行数:31,代码来源:phpliteadmin.php

示例10: libEncoding

 /**
  * The encoding of library
  *
  * @access public
  * @return string
  */
 function libEncoding()
 {
     return sqlite_libencoding();
 }
开发者ID:michaelprem,项目名称:phc,代码行数:10,代码来源:SPSQLite.class.php


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