4 require_once(
'DBMysql.class.php');
62 $error = mysqli_connect_errno();
65 $this->
setError($error, mysqli_connect_error());
68 mysqli_set_charset(
$result,
'utf8');
90 if(version_compare(PHP_VERSION,
"5.4.0",
"<") && get_magic_quotes_gpc())
92 $string = stripslashes(str_replace(
"\\",
"\\\\", $string));
94 if(!is_numeric($string))
97 $string = mysqli_escape_string(
$connection, $string);
111 if($this->use_prepared_statements ==
'Y')
127 foreach($params as $key => $param)
129 $copy[$key] = $param;
130 $args[$i++] = &$copy[$key];
134 $status = call_user_func_array(
'mysqli_stmt_bind_param',
$args);
142 $status = mysqli_stmt_execute($stmt);
182 foreach($this->param as $k => $o)
184 $value = $o->getUnescapedValue();
185 $type = $o->getType();
188 if($o->isColumnName())
207 foreach($value as $v)
229 if($this->use_prepared_statements !=
'Y')
231 return parent::_fetch(
$result, $arrayIndexEndValue);
241 $meta = mysqli_stmt_result_metadata($stmt);
242 $fields = mysqli_fetch_fields($meta);
249 $longtext_exists =
false;
250 foreach($fields as $field)
252 if(isset($resultArray[$field->name]))
254 $field->name =
'repeat_' . $field->name;
258 $row[$field->name] =
"";
259 $resultArray[$field->name] = &$row[$field->name];
261 if($field->type == 252)
263 $longtext_exists =
true;
266 $resultArray = array_merge(array($stmt), $resultArray);
270 mysqli_stmt_store_result($stmt);
273 call_user_func_array(
'mysqli_stmt_bind_result', $resultArray);
276 while(mysqli_stmt_fetch($stmt))
278 $resultObject =
new stdClass();
280 foreach($resultArray as $key => $value)
286 if(strpos($key,
'repeat_'))
288 $key = substr($key, 6);
290 $resultObject->$key = $value;
293 $rows[] = $resultObject;
296 mysqli_stmt_close($stmt);
298 if($arrayIndexEndValue)
300 foreach($rows as $row)
302 $output[$arrayIndexEndValue--] = $row;
312 if(isset($arrayIndexEndValue))
333 if($this->use_prepared_statements !=
'Y')
335 return parent::_executeInsertAct($queryObject);
337 $this->param = $queryObject->getArguments();
338 $result = parent::_executeInsertAct($queryObject, $with_values);
351 if($this->use_prepared_statements !=
'Y')
353 return parent::_executeUpdateAct($queryObject);
355 $this->param = $queryObject->getArguments();
356 $result = parent::_executeUpdateAct($queryObject, $with_values);
369 if($this->use_prepared_statements !=
'Y')
371 return parent::_executeDeleteAct($queryObject);
373 $this->param = $queryObject->getArguments();
374 $result = parent::_executeDeleteAct($queryObject, $with_values);
390 if($this->use_prepared_statements !=
'Y')
392 return parent::_executeSelectAct($queryObject,
$connection);
394 $this->param = $queryObject->getArguments();
419 return mysqli_fetch_object(
$result);
429 return mysqli_free_result(
$result);
setError($errno=0, $errstr= 'success')
__query($query, $connection)
_executeSelectAct($queryObject, $connection=null, $with_values=false)
isConnected($type= 'master', $indx=0)
_fetch($result, $arrayIndexEndValue=NULL)
_executeInsertAct($queryObject, $with_values=false)
db_fetch_object(&$result)
_executeUpdateAct($queryObject, $with_values=false)
_prepareQueryParameters(&$types, &$params)
__construct($auto_connect=TRUE)
_connect($type= 'master', $indx=0)
_getConnection($type= 'master', $indx=NULL)
_executeDeleteAct($queryObject, $with_values=false)