Oct 25, 2009 0
Forcing Windows to Change Priority
ntsd -c qd taskmgr
Jan 15, 2009 0
Ciąg dalszy walki z CodeIgniterem przyniósł kolejne problemy… tym razem pojawił się błąd w trakcie korzystania z procedur:
A Database Error Occurred
Error Number: 2014
Commands out of sync; you can't run this command now
Rozwizaniem jest podmienienie funkcji function _execute($sql) w /system/databases/drivers/mysqli/mysqli_driver.php na:
function _execute($sql)
{
// Free result from previous query
@mysqli_free_result($this->result_id);
$sql = $this->_prep_query($sql);
// get a result code of query (), can be used for test is the query ok
$retval = @mysqli_multi_query($this->conn_id, $sql);
// get a first resultset
$firstResult = @mysqli_store_result($this->conn_id);
// free other resultsets
while (@mysqli_next_result($this->conn_id)) {
$result = @mysqli_store_result($this->conn_id);
@mysqli_free_result($result);
}
// test is the error occur or not
if (!$firstResult && !@mysqli_errno($this->conn_id)) {
return true;
}
return $firstResult;
}
Jan 13, 2009 0
Używając CodeIgnitera z procedurami z MySLQ 5 napotkałem się na błąd:
A Database Error Occurred
Error Number: 1312
PROCEDURE usr_uzytkownik_sel_check_login can't return a result set in the given context
CALL usr_uzytkownik_sel_check_login();
Obejściem togo jest zmiana w /System/database/drivers/mysql/mysql_driver.php funkcji db_connect() na
function db_connect() {
define("CLIENT_MULTI_RESULTS",131072);//Enable/disable multi-results
define("CLIENT_MULTI_STATEMENTS",65536);//Enable/disable multi-statement support
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE,CLIENT_MULTI_STATEMENTS);
}
i ustawienie w configu database.php
$db['default']['pconnect'] = FALSE;
Teraz już możemy odwoływać się do naszej procedury z modelu
$sql = 'call usr_uzytkownik_sel_check_login(?)';
$param = array($login);
return $query = $this->db->query($sql, $param);