function _fetch($ignore_fields = false) { $this->fields = @fbsql_fetch_array($this->_queryID, $this->fetchMode); return $this->fields == true; }
/** * Places a row from the result set into the given array * * Formating of the array and the data therein are configurable. * See DB_result::fetchInto() for more information. * * This method is not meant to be called directly. Use * DB_result::fetchInto() instead. It can't be declared "protected" * because DB_result is a separate object. * * @param resource $result the query result resource * @param array $arr the referenced array to put the data in * @param int $fetchmode how the resulting array should be indexed * @param int $rownum the row number to fetch (0 = first row) * * @return mixed DB_OK on success, NULL when the end of a result set is * reached or on failure * * @see DB_result::fetchInto() */ function fetchInto($result, &$arr, $fetchmode, $rownum = null) { if ($rownum !== null) { if (!@fbsql_data_seek($result, $rownum)) { return null; } } if ($fetchmode & DB_FETCHMODE_ASSOC) { $arr = @fbsql_fetch_array($result, FBSQL_ASSOC); if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) { $arr = array_change_key_case($arr, CASE_LOWER); } } else { $arr = @fbsql_fetch_row($result); } if (!$arr) { return null; } if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { $this->_convertNullArrayValuesToEmpty($arr); } return DB_OK; }
protected function convertResource($resource) { $resourceType = get_resource_type($resource); switch ($resourceType) { #case 'dbm': #case 'dba': #case 'dbase': #case 'domxml attribute': #case 'domxml document': #case 'domxml node': case 'fbsql result': $rows = array(); $indexType = $this->dbResultIndexType == 'ASSOC' ? FBSQL_ASSOC : FBSQL_NUM; while ($row = fbsql_fetch_array($resource, $indexType)) { array_push($rows, $row); } return $rows; #case 'gd': #return base64 #case 'gd': #return base64 case 'msql query': $rows = array(); $indexType = $this->dbResultIndexType == 'ASSOC' ? MSQL_ASSOC : MSQL_NUM; while ($row = msql_fetch_array($resource, $indexType)) { array_push($rows, $row); } return $rows; case 'mssql result': $rows = array(); $indexType = $this->dbResultIndexType == 'ASSOC' ? MSSQL_ASSOC : MSSQL_NUM; while ($row = mssql_fetch_array($resource, $indexType)) { array_push($rows, $row); } return $rows; case 'mysql result': $rows = array(); $indexType = $this->dbResultIndexType == 'ASSOC' ? MYSQL_ASSOC : MYSQL_NUM; while ($row = mysql_fetch_array($resource, $indexType)) { array_push($rows, $row); } return $rows; case 'odbc result': $rows = array(); if ($this->dbResultIndexType == 'ASSOC') { while ($row = odbc_fetch_array($resource)) { array_push($rows, $row); } } else { while ($row = odbc_fetch_row($resource)) { array_push($rows, $row); } } return $rows; #case 'pdf document': #case 'pdf document': case 'pgsql result': $rows = array(); $indexType = $this->dbResultIndexType == 'ASSOC' ? PGSQL_ASSOC : PGSQL_NUM; while ($row = pg_fetch_array($resource, $indexType)) { array_push($rows, $row); } return $rows; case 'stream': return stream_get_contents($resource); case 'sybase-db result': case 'sybase-ct result': $rows = array(); if ($this->dbResultIndexType == 'ASSOC') { while ($row = sybase_fetch_assoc($resource)) { array_push($rows, $row); } } else { while ($row = sybase_fetch_row($resource)) { array_push($rows, $row); } } return $rows; #case 'xml': #case 'xml': default: trigger_error("Unable to return resource type '{$resourceType}'."); } }
/** * Fetch a row and insert the data into an existing array. * * @param $result fbsql result identifier * @param $arr (reference) array where data from the row is stored * @param $fetchmode how the array data should be indexed * @param $rownum the row number to fetch * @access public * * @return int DB_OK on success, a DB error on failure */ function fetchInto($result, &$arr, $fetchmode, $rownum = null) { if ($rownum !== null) { if (!@fbsql_data_seek($result, $rownum)) { return null; } } if ($fetchmode & DB_FETCHMODE_ASSOC) { $arr = @fbsql_fetch_array($result, FBSQL_ASSOC); } else { $arr = @fbsql_fetch_row($result); } if (!$arr) { $errno = @fbsql_errno($this->connection); if (!$errno) { return NULL; } return $this->fbsqlRaiseError($errno); } return DB_OK; }
<?php include "linkpass.php"; mysqli_select_db($link, "donor"); $result = mysqli_query($link, "SELECT idno, name from donor") or die("<br>Invalid query: " . mysqli_error($link)); //This is called a front based function while ($row = fbsql_fetch_array($result)) { echo "<p>ID = " . $row["idno"] . ", NAME = " . $row["name"] . "<br>"; echo "ID = " . $row[0] . ", NAME = " . $row[1] . "</p>"; } ?>
public function fetchArray() { if (!empty($this->query)) { return fbsql_fetch_array($this->query); } else { return false; } }