報錯...
[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
你可以截圖下你的報錯信息
報錯頁面是什么樣子 理論上沒有任何問題?
另外記得 開 pdo
2017-11-03
2017-06-28
補圖片。
2017-06-28
檢查數據庫配置以及你的本地數據庫是否啟動;