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


PHP sqlite_num_rows函数代码示例

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


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

示例1: set

 public function set($key, $val, $immutable = false)
 {
     if ($immutable) {
         $this->immutableSet($key, $val);
     } else {
         if (empty($val)) {
             sqlite_query($this->db, "DELETE FROM is4c_local WHERE keystr='{$key}'");
         } else {
             if (is_array($val)) {
                 $temp = "";
                 foreach ($val as $v) {
                     $temp .= $v . chr(255);
                 }
                 $val = substr($temp, 0, strlen($temp) - 1);
             } elseif ($val === false) {
                 $val = 'FALSE';
             } elseif ($val === true) {
                 $val = 'TRUE';
             }
             $check = sqlite_query($this->db, "SELECT valstr FROM is4c_local WHERE keystr='{$key}'");
             if (sqlite_num_rows($check) == 0) {
                 sqlite_query($this->db, "INSERT INTO is4c_local VALUES ('{$key}','{$val}')");
             } else {
                 sqlite_query($this->db, "UPDATE is4c_local SET valstr='{$val}' WHERE keystr='{$key}'");
             }
         }
     }
     $this->debug();
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:29,代码来源:SQLiteStorage.php

示例2: num_rows

 function num_rows($query_id = "")
 {
     if ($query_id == "") {
         $query_id = $this->query_id;
     }
     return @sqlite_num_rows($query_id);
 }
开发者ID:rust1989,项目名称:edit,代码行数:7,代码来源:db_sqlite.php

示例3: sendQuery

 /**
  * Method to send SQL query
  *
  * @param   resource    $res_conn
  * @return  void
  */
 private function sendQuery($res_conn)
 {
     // checking query type
     // if the query return recordset or not
     if (preg_match("/^(SELECT)\\s/i", $this->sql_string)) {
         $this->res_result = @sqlite_query($res_conn, $this->sql_string);
         // error checking
         if (!$this->res_result) {
             $this->errno = sqlite_last_error($res_conn);
             $this->error = "Query failed to executed. Please check your query again. \n" . sqlite_error_string($this->errno);
         } else {
             // count number of rows
             $this->num_rows = @sqlite_num_rows($this->res_result);
         }
     } else {
         $_query = @sqlite_unbuffered_query($res_conn, $this->sql_string);
         $this->insert_id = sqlite_last_insert_rowid($res_conn);
         // error checking
         if (!$_query) {
             $this->errno = sqlite_last_error($res_conn);
             $this->error = "Query failed to executed. Please check your query again. \n" . sqlite_error_string($this->errno);
         } else {
             // get number of affected row
             $this->affected_rows = @sqlite_changes($res_conn);
         }
         // nullify query
         $_query = null;
     }
 }
开发者ID:purwoko,项目名称:SENAYAN-3-Stable,代码行数:35,代码来源:simbio_sqlite_result.inc.php

示例4: numRows

 /**
  * Returns the number of rows in the recordset
  *
  * @return int
  */
 public function numRows()
 {
     if ($this->result) {
         return sqlite_num_rows($this->result);
     } else {
         return 0;
     }
 }
开发者ID:TheProjecter,项目名称:skeleton,代码行数:13,代码来源:Sqlite.php

示例5: total_count

 protected function total_count()
 {
     $count = @sqlite_num_rows($this->_result);
     if (!$count > 0) {
         $count = 0;
     }
     return $count;
 }
开发者ID:google2013,项目名称:myqeecms,代码行数:8,代码来源:Result.class.php

示例6: getRecordCount

 /**
  * @see ResultSet::getRecordCount()
  */
 public function getRecordCount()
 {
     $rows = @sqlite_num_rows($this->result);
     if ($rows === null) {
         throw new SQLException("Error fetching num rows", sqlite_error_string(sqlite_last_error($this->conn->connection)));
     }
     return (int) $rows;
 }
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:11,代码来源:SQLiteResultSet.php

示例7: write

 public static function write($id, $data)
 {
     $id = "'" . sqlite_escape_string($id) . "'";
     $expire = time() + 2 * WEEK;
     $R = sqlite_query("SELECT id FROM sess WHERE id = {$id}", SESSION_DB_LINK);
     sqlite_query(sqlite_num_rows($R) ? "UPDATE sess SET data = '{$data}', expire = {$expire} WHERE id = {$id}" : "INSERT INTO sess (id, data, expire) VALUES ({$id}, '{$data}', {$expire})", SESSION_DB_LINK);
     return sqlite_changes(SESSION_DB_LINK) ? true : false;
 }
开发者ID:laiello,项目名称:php-garden,代码行数:8,代码来源:session.php

示例8: count

 public function count()
 {
     $lastresult = $this->results[$this->lasthash];
     //print_r($this->results);
     $count = sqlite_num_rows($lastresult);
     if (!$count) {
         $count = 0;
     }
     return $count;
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:10,代码来源:sqlitedriver.php

示例9: num_rows

function num_rows($query_results)
{
    if (DATABASE_TYPE == "mysql") {
        $num_rows = mysqli_num_rows($query_results);
    } elseif (DATABASE_TYPE == "sqlite") {
        $num_rows = sqlite_num_rows($query_results);
    } elseif (DATABASE_TYPE == "pgsql") {
        $num_rows = pg_num_rows($query_results);
    }
    return $num_rows;
}
开发者ID:Alamantus,项目名称:PHP-App-Base,代码行数:11,代码来源:helpers.php

示例10: sql_numrows

 function sql_numrows($query_id = 0)
 {
     if (!$query_id) {
         $query_id = $this->query_result;
     }
     if ($query_id) {
         return @sqlite_num_rows($query_id);
     } else {
         return false;
     }
 }
开发者ID:rotvulpix,项目名称:php-nuke,代码行数:11,代码来源:sqlite.php

示例11: getLength

 public function getLength()
 {
     if ($this->r === true) {
         return sqlite_changes($this->r);
     } else {
         if ($this->r === false) {
             return 0;
         }
     }
     return sqlite_num_rows($this->r);
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:11,代码来源:SqliteResultSet.class.php

示例12: sql_num_rows

function sql_num_rows($data)
{
    if (defined('DB_TYPE')) {
        if (DB_TYPE == 'mysql') {
            $sql = mysql_num_rows($data);
        } elseif (DB_TYPE == 'sqlite') {
            $sql = sqlite_num_rows($data);
        }
        return $sql;
    }
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:11,代码来源:sql_num_rows.php

示例13: checkCredentials

 function checkCredentials($userid, $password, Request $message)
 {
     $db = new dbHandler();
     $link = $db->getDbHandler();
     $query = "SELECT * FROM Security WHERE UserName = '" . $userid . "' and Password = '" . $password . "'";
     $result = sqlite_query($link, $query);
     if (sqlite_num_rows($result) < 1) {
         $db->close();
         throw new WebORBAuthenticationException("invalid userid or password");
     }
     $db->close();
 }
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:12,代码来源:CustomAuthHandler.php

示例14: hasListing

 public function hasListing($a_sListingURL)
 {
     $l_sTmp = md5($a_sListingURL);
     $result = sqlite_query($this->db, "SELECT * FROM listings WHERE l_id = '" . $l_sTmp . "'");
     $rows = sqlite_num_rows($result);
     if ($rows < 1) {
         $result = sqlite_exec($this->db, "INSERT INTO listings VALUES ('{$l_sTmp}')");
         return false;
     } else {
         return true;
     }
 }
开发者ID:sergrin,项目名称:crawlers-il,代码行数:12,代码来源:CSqliteDB.class.php

示例15: cookielogin

 public function cookielogin()
 {
     if (isset($_COOKIE['userid']) && isset($_COOKIE['pass'])) {
         $id = sqlite_escape_string($_COOKIE['userid']);
         $pass = sqlite_escape_string($_COOKIE['pass']);
         $q = sqlite_query($this->db, "SELECT * FROM users WHERE uid = '{$id}' AND password = '{$pass}' LIMIT 1", $e);
         if (sqlite_num_rows($q) > 0) {
             $r = sqlite_fetch_array($q);
             $_SESSION['uid'] = $r['uid'];
             $_SESSION['uname'] = $r['username'];
         }
     }
 }
开发者ID:raccoon4me,项目名称:sqlite-user-auth,代码行数:13,代码来源:userauth.php


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