database.php

来源:互联网 发布:淘宝客qq群加人 编辑:程序博客网 时间:2024/05/01 19:03
<?php$database_connection=null;function get_connection(){$hostname="localhost";$database="news";$username="root";$pasword="";global $database_connection;$database_connection=@mysql_connect($hostname,$username,$password)or die(mysql_error());mysql_query("set names 'gbk'");@mysql_select_db($database,$database_connection)or die(mysql_error());}function close_connection(){global $database_connection;if($database_connection){mysql_close($database_connection)or die(mysql_error());}}?>

原创粉丝点击