#623 | PDO::ATTR_TIMEOUT => 5, |
#624 | ); |
#625 | $link = new PDO("mysql:host=$host;port=$port;dbname=$name;charset=$charset", $user, $pass, $attr); |
#626 | } catch (Exception $e) { |
#627 | throw new Exception('连接数据库服务器失败:'.mb_convert_encoding($e->getMessage(),'UTF-8','GBK')); |
#628 | } |
#629 | if($charset){ |
#630 | $link->query('SET NAMES '.$charset.', sql_mode=""'); |
#631 | }else{ |
#632 | $link->query('SET sql_mode=""'); |