27 #require_once 'Zend/Db/Statement.php'; 68 $mysqli = $this->_adapter->getConnection();
70 $this->_stmt = $mysqli->prepare($sql);
72 if ($this->_stmt ===
false || $mysqli->errno) {
76 #require_once 'Zend/Db/Statement/Mysqli/Exception.php'; 105 $r = $this->_stmt->close();
119 if ($stmt = $this->_stmt) {
120 $mysqli = $this->_adapter->getConnection();
121 while ($mysqli->more_results()) {
122 $mysqli->next_result();
124 $this->_stmt->free_result();
125 return $this->_stmt->reset();
138 if (isset($this->_meta) && $this->_meta) {
139 return $this->_meta->field_count;
155 return substr($this->_stmt->sqlstate, 0, 5);
170 substr($this->_stmt->sqlstate, 0, 5),
197 $stmtParams = array();
199 $stmtParams[$k] = &
$value;
201 call_user_func_array(
202 array($this->_stmt,
'bind_param'),
208 $retval = $this->_stmt->execute();
209 if ($retval ===
false) {
213 #require_once 'Zend/Db/Statement/Mysqli/Exception.php'; 219 if ($this->_meta ===
null) {
220 $this->_meta = $this->_stmt->result_metadata();
221 if ($this->_stmt->errno) {
225 #require_once 'Zend/Db/Statement/Mysqli/Exception.php'; 231 if ($this->_meta !==
false) {
234 $this->_keys = array();
235 foreach ($this->_meta->fetch_fields() as $col) {
236 $this->_keys[] = $this->_adapter->foldCase($col->name);
240 $this->_values = array_fill(0, count($this->_keys),
null);
246 foreach ($this->_values as
$i => &$f) {
250 $this->_stmt->store_result();
252 call_user_func_array(
253 array($this->_stmt,
'bind_result'),
270 public function fetch($style =
null, $cursor =
null, $offset =
null)
276 $retval = $this->_stmt->fetch();
280 $this->_stmt->reset();
287 if ($style ===
null) {
294 foreach ($this->_values as $key => $val) {
307 $assoc = array_combine($this->_keys,
$values);
311 $row = (object) array_combine($this->_keys,
$values);
314 $assoc = array_combine($this->_keys,
$values);
322 #require_once 'Zend/Db/Statement/Mysqli/Exception.php'; 342 #require_once 'Zend/Db/Statement/Mysqli/Exception.php'; 355 if (!$this->_adapter) {
358 $mysqli = $this->_adapter->getConnection();
359 return $mysqli->affected_rows;
_bindParam($parameter, &$variable, $type=null, $length=null, $options=null)
_execute(array $params=null)
fetch($style=null, $cursor=null, $offset=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]