• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mysqli_data_seek函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: rewind

 function rewind()
 {
     if (isset($this->queryId) && $this->_is_resource($this->queryId) && mysqli_num_rows($this->queryId)) {
         if (mysqli_data_seek($this->queryId, 0) === false) {
             $this->connection->_raiseError();
         }
     } elseif (!$this->queryId) {
         $query = $this->query;
         if (is_array($this->sort_params)) {
             if (preg_match('~(?<=FROM).+\\s+ORDER\\s+BY\\s+~i', $query)) {
                 $query .= ',';
             } else {
                 $query .= ' ORDER BY ';
             }
             foreach ($this->sort_params as $field => $order) {
                 $query .= $this->connection->quoteIdentifier($field) . " {$order},";
             }
             $query = rtrim($query, ',');
         }
         if ($this->limit) {
             $query .= ' LIMIT ' . $this->offset . ',' . $this->limit;
         }
         $this->queryId = $this->connection->execute($query);
     }
     $this->key = 0;
     $this->next();
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:27,代码来源:lmbMysqliRecordSet.class.php


示例2: seek

 /**
  * Seek
  *
  * @param   int offset
  * @return  bool success
  * @throws  rdbms.SQLException
  */
 public function seek($offset)
 {
     if (!mysqli_data_seek($this->handle, $offset)) {
         throw new SQLException('Cannot seek to offset ' . $offset);
     }
     return true;
 }
开发者ID:xp-framework,项目名称:rdbms,代码行数:14,代码来源:MySQLiResultSet.class.php


示例3: old_mysql_result

/**
 * Fonction basée sur l'api mysqli et
 * simulant la fonction mysql_result()
 * Copyright 2014 Marc Leygnac
 *
 * @param type $result résultat après requête
 * @param integer $row numéro de la ligne
 * @param string/integer $field indice ou nom du champ
 * @return type valeur du champ ou false si erreur
 */
function old_mysql_result($result, $row, $field = 0)
{
    if ($result === false) {
        return false;
    }
    if ($row >= mysqli_num_rows($result)) {
        return false;
    }
    if (is_string($field) && !(strpos($field, ".") === false)) {
        // si $field est de la forme table.field ou alias.field
        // on convertit $field en indice numérique
        $t_field = explode(".", $field);
        $field = -1;
        $t_fields = mysqli_fetch_fields($result);
        for ($id = 0; $id < mysqli_num_fields($result); $id++) {
            if ($t_fields[$id]->table == $t_field[0] && $t_fields[$id]->name == $t_field[1]) {
                $field = $id;
                break;
            }
        }
        if ($field == -1) {
            return false;
        }
    }
    mysqli_data_seek($result, $row);
    $line = mysqli_fetch_array($result);
    return isset($line[$field]) ? $line[$field] : false;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:38,代码来源:old_mysql_result.php


示例4: getAllScheduleTimeslotsBetween

function getAllScheduleTimeslotsBetween($startTime, $endTime)
{
    $timeslots = array();
    $result = openConnection("Call get_all_schedule_timeslots();");
    //var_dump($result);
    //$result = openConnection("get_all_schedule_timeslots_between(".$startTime.", ".$endTime.");");
    $timeslots;
    if ($result->num_rows > 0) {
        mysqli_data_seek($result, 0);
        while ($row = $result->fetch_assoc()) {
            $startTime = $row['startTime'];
            $endTime = $row['endTime'];
            $timeslotId = $row['timeslotId'];
            $firefighterId = $row['firefighterId'];
            $firstName = $row['firstName'];
            $lastName = $row['lastName'];
            $email = $row['email'];
            $phone = $row['phone'];
            $secondaryPhone = $row['secondaryPhone'];
            $carrier = $row['phoneProvider'];
            $scheduleTimeslotId = $row['scheduleTimeslotId'];
            $firefighter = new Firefighter($firefighterId, $firstName, $lastName, $email, $phone, $secondaryPhone, $carrier);
            $timeslot = new TimeSlot($timeslotId, $startTime, $endTime, $firefighter);
            $scheduleTimeslot = new ScheduleTimeslot($timeslot, $scheduleTimeslotId);
            array_push($timeslots, $scheduleTimeslot);
        }
    }
    return $timeslots;
}
开发者ID:Goldenpearl,项目名称:CS495_FireDept,代码行数:29,代码来源:scheduleGrab.php


示例5: rewind

 public function rewind()
 {
     if ($this->index > 0) {
         @mysqli_data_seek($this->resource, 0);
         $this->index = 0;
     }
     $this->next();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:MySQLSelectQueryResult.class.php


示例6: seek

 /**
  * Moves the internal pointer to the specified row position.
  *
  * @param int $row Row position; zero-based and set to 0 by default
  *
  * @return bool Boolean true on success, false otherwise
  */
 public function seek($row = 0)
 {
     if (is_int($row) && $row >= 0 && $row < $this->num_rows) {
         return mysqli_data_seek($this->result, $row);
     } else {
         return false;
     }
 }
开发者ID:nramenta,项目名称:dabble,代码行数:15,代码来源:Result.php


示例7: rowSeek

 public function rowSeek($rowNum)
 {
     $re = @mysqli_data_seek($this->query_result, $rowNum);
     if (!$re) {
         throw new Exception($this->errorInfo());
     }
     return $re;
 }
开发者ID:ravenlp,项目名称:FlavorPHP,代码行数:8,代码来源:mysqli_db.class.php


示例8: fetch_result

 function fetch_result($result, $row, $param)
 {
     if (mysqli_data_seek($result, $row)) {
         $line = mysqli_fetch_assoc($result);
         return $line[$param];
     }
     return false;
 }
开发者ID:adrianpietka,项目名称:bfrss,代码行数:8,代码来源:mysqli.php


示例9: reset

 function reset()
 {
     if ($this->row > 0) {
         mysqli_data_seek($this->id, 0);
     }
     $this->row = -1;
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb,代码行数:8,代码来源:mysqli.php


示例10: Reset

 function Reset()
 {
     if ($this->ctype == 'mysqli') {
         mysqli_data_seek($this->result, 0);
     } else {
         mysql_data_seek($this->result, 0);
     }
     return TRUE;
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:9,代码来源:kunena.db.iterator.class.php


示例11: next

 function next()
 {
     $this->cur++;
     if ($this->cur > $this->max) {
         return false;
     }
     mysqli_data_seek($this->res, $this->cur);
     return mysqli_fetch_assoc($this->res);
 }
开发者ID:rgigger,项目名称:zinc,代码行数:9,代码来源:DbMysqlResult.php


示例12: seek

 public function seek($offset)
 {
     if ($this->offsetExists($offset) && \mysqli_data_seek($this->_result, $offset)) {
         $this->_current_row = $this->_internal_row = $offset;
         return true;
     } else {
         return false;
     }
 }
开发者ID:google2013,项目名称:myqee,代码行数:9,代码来源:result.class.php


示例13: mysqliAdapter

 /**
  * Constructor method for the adapter.  This constructor implements the setting of the
  * 3 required properties for the object.
  * 
  * @param resource $d The datasource resource
  */
 function mysqliAdapter($d)
 {
     parent::RecordSetAdapter($d);
     $fieldcount = mysqli_num_fields($d);
     $ob = "";
     $be = $this->isBigEndian;
     $fc = pack('N', $fieldcount);
     if (mysqli_num_rows($d) > 0) {
         mysqli_data_seek($d, 0);
         while ($line = mysqli_fetch_row($d)) {
             // write all of the array elements
             $ob .= "\n" . $fc;
             foreach ($line as $value) {
                 // write all of the array elements
                 if (is_string($value)) {
                     // type as string
                     $os = $this->_directCharsetHandler->transliterate($value);
                     //string flag, string length, and string
                     $len = strlen($os);
                     if ($len < 65536) {
                         $ob .= "" . pack('n', $len) . $os;
                     } else {
                         $ob .= "\f" . pack('N', $len) . $os;
                     }
                 } elseif (is_float($value) || is_int($value)) {
                     // type as double
                     $b = pack('d', $value);
                     // pack the bytes
                     if ($be) {
                         // if we are a big-endian processor
                         $r = strrev($b);
                     } else {
                         // add the bytes to the output
                         $r = $b;
                     }
                     $ob .= "" . $r;
                 } elseif (is_bool($value)) {
                     //type as bool
                     $ob .= "";
                     $ob .= pack('c', $value);
                 } elseif (is_null($value)) {
                     // null
                     $ob .= "";
                 }
             }
         }
     }
     $this->serializedData = $ob;
     // loop over all of the fields
     while ($field = mysqli_fetch_field($d)) {
         // decode each field name ready for encoding when it goes through serialization
         // and save each field name into the array
         $this->columnNames[] = $this->_directCharsetHandler->transliterate($field->name);
     }
     $this->numRows = mysqli_num_rows($d);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:62,代码来源:mysqliAdapter.php


示例14: data_seek

function data_seek($result, $row = 0, $dbtype = 'mysql')
{
    if ($dbtype == 'mysql') {
        mysqli_data_seek($result, $row);
    } else {
        if ($dbtype == 'postgres') {
            pg_result_seek($result, $row);
        }
    }
}
开发者ID:rjevansatari,项目名称:Analytics,代码行数:10,代码来源:db.php


示例15: seek

 public function seek($offset)
 {
     if ($this->offsetExists($offset) and mysqli_data_seek($this->_result, $offset)) {
         // Set the current row to the offset
         $this->_current_row = $this->_internal_row = $offset;
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:10,代码来源:result.php


示例16: seek

 /**
  * @see ResultSet::seek()
  */
 public function seek($rownum)
 {
     // MySQL rows start w/ 0, but this works, because we are
     // looking to move the position _before_ the next desired position
     if (!@mysqli_data_seek($this->result, $rownum)) {
         return false;
     }
     $this->cursorPos = $rownum;
     return true;
 }
开发者ID:rodrigoprestesmachado,项目名称:whiteboard,代码行数:13,代码来源:MySQLiResultSet.php


示例17: mysqlresult

/**
* function to override mysql_result
*/
function mysqlresult($res,$row=0,$col=0){ 
	$numrows = mysqli_num_rows($res); 
	if ($numrows && $row <= ($numrows-1) && $row >=0){
		mysqli_data_seek($res,$row);
		$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
		if (isset($resrow[$col])){
			return $resrow[$col];
		}
	}
	return false;
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:14,代码来源:conf.db.example.php


示例18: get_result_as_arrays

function get_result_as_arrays($result)
{
    for ($i = 0; $i < $result->num_rows; $i++) {
        if (!mysqli_data_seek($result, $i)) {
            return false;
        } else {
            $data[] = mysqli_fetch_row($result);
        }
    }
    return $data;
}
开发者ID:andywgarcia,项目名称:campuslifeohs,代码行数:11,代码来源:sql_to_csv.php


示例19: MysqliResultQualtiva

function MysqliResultQualtiva($res, $row = 0, $col = 0)
{
    $numrows = MysqliNumRowsQualtiva($res);
    if ($numrows && $row <= $numrows - 1 && $row >= 0) {
        mysqli_data_seek($res, $row);
        $resrow = is_numeric($col) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
        if (isset($resrow[$col])) {
            return $resrow[$col];
        }
    }
    return false;
}
开发者ID:kailIII,项目名称:StockAPP,代码行数:12,代码来源:metodo.php


示例20: result

 function result($query_id = 0, $row = 0)
 {
     if ($query_id) {
         if ($row) {
             @mysqli_data_seek($query_id, $row);
         }
         $cur_row = @mysqli_fetch_row($query_id);
         return $cur_row[0];
     } else {
         return false;
     }
 }
开发者ID:patrickod,项目名称:City-Blogger,代码行数:12,代码来源:mysqli.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mysqli_errno函数代码示例发布时间:2022-05-15
下一篇:
PHP mysqli_connect_error函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap