【发布时间】:2019-01-29 08:57:12
【问题描述】:
当其他一些进程在执行过程中需要一些时间时,MySQL 查询失败,我称该查询失败了一段时间。当我开始查询时,这里永远不会失败是我的模型 model_common
function get_where_custom($table, $column, $value) {
$this->db->where($column, $value);
$query = $this->db->get($table);
return $query;
}
//这是我的控制器
function _get_where($table, $query = array(), $select = "*",$limit = NULL, $offset = NULL, $order_by = 'id', $order_as = 'desc')
{
$this->load->model('model_common');
if( $this->db->conn_id->ping() == FALSE){
$this->model_common->reconnect();
}
$query = $this->model_common->get_where($table, $query, $select, $limit, $offset , $order_by, $order_as);
return $query;
}
【问题讨论】:
-
您的代码中没有调用
real_escape_string
标签: php mysql codeigniter