|
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
- require_once __DIR__.'/Config.php';
- function conn(){
- $port=defined('MYSQL_PORT')?MYSQL_PORT:3306;
- try {
- $pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=".MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
- return $pdo;
- }catch (PDOException $e){
- writeLog('new PDO failed:'.$e->getMessage());
- }
- }
-
-
-
|