報(bào)錯(cuò)...
[8]ErrorExceptionin Mysql.php line 34
Array to string conversion
? ?/** ? ? * 解析pdo連接的dsn信息 ? ? * @access protected ? ? * @param array $config 連接信息 ? ? * @return string ? ? */ ? ?protected function parseDsn($config) ? ?{ ? ? ? ?$dsn = 'mysql:dbname=' . $config['database'] . ';host=' . $config['hostname']; ? ? ? ?if (!empty($config['hostport'])) { ? ? ? ? ? ?$dsn .= ';port=' . $config['hostport']; ? ? ? ?} elseif (!empty($config['socket'])) { ? ? ? ? ? ?$dsn .= ';unix_socket=' . $config['socket']; ? ? ? ?} ? ? ? ?if (!empty($config['charset'])) { ? ? ? ? ? ?$dsn .= ';charset=' . $config['charset']; ? ? ? ?} ? ? ? ?return $dsn;
明明和視頻老師代碼一樣的...
2017-06-28
你可以截圖下你的報(bào)錯(cuò)信息
報(bào)錯(cuò)頁面是什么樣子 理論上沒有任何問題?
另外記得 開 pdo
2017-11-03
2017-06-28
補(bǔ)圖片。
2017-06-28
檢查數(shù)據(jù)庫配置以及你的本地?cái)?shù)據(jù)庫是否啟動(dòng);