SYSTEMPATH/Database/BaseConnection.php at line 407 400 break; 401 } 402 } 403 } 404 405 // We still don't have a connection? 406 if (! $this->connID) { 407 throw new DatabaseException(sprintf( 408 'Unable to connect to the database.%s%s', 409 PHP_EOL, 410 implode(PHP_EOL, $connectionErrors) 411 )); 412 } 413 } 414 Backtrace Server Request Response Files Memory SYSTEMPATH/Database/BaseConnection.php : 577 — CodeIgniter\Database\BaseConnection->initialize () 570 * @todo BC set $queryClass default as null in 4.1 571 */ 572 public function query(string $sql, $binds = null, bool $setEscapeFlags = true, string $queryClass = '') 573 { 574 $queryClass = $queryClass ?: $this->queryClass; 575 576 if (empty($this->connID)) { 577 $this->initialize(); 578 } 579 580 /** 581 * @var Query $query 582 */ 583 $query = new $queryClass($this); 584 APPPATH/Core/View.php : 2212 — CodeIgniter\Database\BaseConnection->query ( arguments ) 2205 } 2206 $sql = str_replace($this->_select_rt_name, 'sum('.$system['sum'].') as ct', $sql); 2207 break; 2208 } 2209 } 2210 2211 // 执行SQL 2212 $query = $mysql->query($sql); 2213 2214 if (!$query) { 2215 return 'SQL查询解析不正确:'.$sql; 2216 } 2217 2218 // 查询结果 2219 $data = $all ? $query->getResultArray() : $query->getRowArray(); APPPATH/Core/View.php : 1946 — Phpcmf\View->_query ( arguments ) 1939 $sql_limit = "LIMIT {$system['num']}"; 1940 } 1941 1942 $system['order'] = $this->_set_orders_field_prefix($system['order'], $_order); // 给排序字段加上表前缀 1943 $sql = "SELECT " .$this->_get_select_field($system['field'] ? $system['field'] : '*') . " FROM $sql_from " . ($sql_where ? "WHERE $sql_where" : "") . ($system['order'] == "null" || !$system['order'] ? "" : " ORDER BY {$system['order']}") . " $sql_limit"; 1944 } 1945 1946 $data = $this->_query($sql, $system); 1947 1948 // 缓存查询结果 1949 if (is_array($data) && $data) { 1950 // 模块表的系统字段 1951 $fields['inputtime'] = ['fieldtype' => 'Date']; 1952 $fields['updatetime'] = ['fieldtype' => 'Date']; 1953 // 格式化显示自定义字段内容 /usr/home/xyu……/htdocs/cache/template/template_pc_default_home_index.html.cache.php : 26 — Phpcmf\View->list_tag ( arguments ) 19
20
21
22