Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#18 Support NextRecordSet() in MySQLi driver

open
nobody
None
5
2006-10-05
2006-10-05
No

This code solved:

#In adodb-mysqli.inc.php line 621:

// returns queryID or false
function _query($sql, $inputarr)
{
global $ADODB_COUNTRECS;
if (is_array($sql))
{
$stmt = $sql[1];
$a = '';
foreach($inputarr as $k => $v)
{
if (is_string($v)) $a .= 's';
else if (is_integer($v)) $a .= 'i';
else $a .= 'd';
}

$fnarr = array_merge( array($stmt,$a) , $inputarr);

$ret =
call_user_func_array('mysqli_stmt_bind_param',$fnarr);

$ret = mysqli_stmt_execute($stmt);
return $ret;
}

/* if(!$mysql_res = mysqli_query($this->_connectionID,
$sql, ($ADODB_COUNTRECS) ? MYSQLI_STORE_RESULT :
MYSQLI_USE_RESULT))
{
if ($this->debug) ADOConnection::outp("Query: " . $sql
. " failed. " . $this->ErrorMsg() );
return false;
}
return $mysql_res;
// */

if( $rs=mysqli_multi_query($this->_connectionID,
$sql.';') )//Contributed by "Geisel Sierote"
<geisel@4up.com.br>
{
$rs=($ADODB_COUNTRECS) ? @mysqli_store_result(
$this->_connectionID ): @mysqli_use_result(
$this->_connectionID );
return $rs?$rs:true; // mysqli_more_results(
$this->_connectionID )
}
else
{
if($this->debug)
ADOConnection::outp("Query: " . $sql . " failed. " .
$this->ErrorMsg());
return false;
}
}

//Contributed by "Geisel Sierote" <geisel@4up.com.br>
function NextRecordSet()
{
global $ADODB_COUNTRECS;
$rs=($ADODB_COUNTRECS) ? @mysqli_store_result(
$this->_connectionID ): @mysqli_use_result(
$this->_connectionID );
if(!$rs)
return false;
$this->_inited = false;
$this->bind = false;
$this->_currentRow = -1;
$this->Init();
return true;
}

Discussion