gpt4 book ai didi

php - 未初始化的字符串偏移量: 0

转载 作者:行者123 更新时间:2023-12-02 10:54:10 25 4
gpt4 key购买 nike

加载数据库时出现此错误:

A PHP Error was encountered Severity: Notice Message: Uninitialized string offset: 0 Filename: mysqli/mysqli_driver.php Line Number: 120 Backtrace: File: /home1/learnio3/public_html/application/controllers/Reading.php Line: 9 Function: database

File: /home1/learnio3/public_html/index.php
Line: 315
Function: require_once

public function __construct() {
parent::__construct();
$this->load->database();
$this->load->helper('url');

}

database.php
$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
'dsn' => '',
'hostname' => '',
'username' => 'learnio3_bram',
'password' => 'xxxxxxx',
'database' => 'learnio3_book',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

最佳答案

将hostname =>''更改为hostname =>'localhost',不要保留为空白,
即使它是网络服务器,cloud9等,也可以通过“localhost”,尽管在phpmyadmin中主机名是“%”

关于php - 未初始化的字符串偏移量: 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41329944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com