function sql_connect() { global MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE; connection = @mysql_connect( MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or startUpError('<p>Could not connect to MySQL database.</p>','Connect Error'); if (!mysql_select_db( MYSQL_DATABASE)) { include'install.php'; doInstall(); mysql_select_db( MYSQL_DATABASE) or startUpError('<p>Could not select database: '. mysql_error().'</p>', 'Connect Error'); } sql_query('set names "gb2312"'); //sql_query是一个自定义的执行查询函数,关键是这个语句 return connection; } |
新闻热点
疑难解答