php 파일이 여러개고.. db접속문과같이 여러번 중복되는 코드를 줄이기위해 include를 사용

<?     include "db.php"; ?>


db.php에는 이런코드가

<? $db = mysql_connect("localhost","root","password"); mysql_select_db("database",$db); mysql_query("set session character_set_connection=utf8;"); mysql_query("set session character_set_results=utf8;"); mysql_query("set session character_set_client=utf8;"); ?>


이런식으로 사용

+ Recent posts