Source for file msql.php
Documentation is available at msql.php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Sterling Hughes <sterling@php.net> |
// | Maintainer: Daniel Convissor <danielc@php.net> |
// +----------------------------------------------------------------------+
// $Id: msql.php,v 1.24 2004/03/05 01:46:53 danielc Exp $
require_once 'DB/common.php';
* Database independent query interface definition for PHP's Mini-SQL
* @version $Id: msql.php,v 1.24 2004/03/05 01:46:53 danielc Exp $
* @author Sterling Hughes <sterling@php.net>
function connect($dsninfo, $persistent = false )
$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost';
$connect_function = $persistent ? 'msql_pconnect' : 'msql_connect';
if ($dbhost && $dsninfo['username'] && $dsninfo['password']) {
$conn = $connect_function($dbhost, $dsninfo['username'],
} elseif ($dbhost && $dsninfo['username']) {
$conn = $connect_function($dbhost, $dsninfo['username']);
$conn = $connect_function($dbhost);
if (!@msql_select_db ($dsninfo['database'], $conn)){
$query = $this->modifyQuery ($query);
// Determine which queries that should return data, and which
// should return an error code only.
* Move the internal msql result pointer to the next available result
* @param a valid fbsql result resource
* @return true if a result is available otherwise return false
* Fetch a row and insert the data into an existing array.
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
* @param resource $result query result identifier
* @param array $arr (reference) array where data from the row
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch
* @return mixed DB_OK on success, null when end of result set is
* @see DB_result::fetchInto()
function fetchInto ($result, &$arr, $fetchmode, $rownum=null )
if (!@msql_data_seek ($result, $rownum)) {
$arr = @msql_fetch_array ($result, MSQL_ASSOC );
$arr = @msql_fetch_row ($result);
if ($error = @msql_error ()) {
$this->_rtrimArrayValues ($arr);
$this->_convertNullArrayValuesToEmpty ($arr);
return @msql_free_result ($result);
$cols = @msql_num_fields ($result);
$rows = @msql_num_rows ($result);
* Gets the number of rows affected by a query.
* @return number of rows affected by the last query
Documentation generated on Mon, 11 Mar 2019 10:14:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|