mysql connect
2023. 3. 29. 23:12ㆍ웹 프로그래밍/PHP
<?php
$HOST_NAME = "localhost";
$USER_ID = "";
$USER_PWD = "";
$DB_NAME = "";
if(!$db_conn = @mysqli_connect($HOST_NAME, $USER_ID, $USER_PWD, $DB_NAME, 3306)){
//mysql_select_db($DB_NAME, $db_conn) or die('COULD NOT SELECT DATABASE.');
echo "mysql not connected ".mysqli_error();
exit;
}
//mysql_query($connection, "set names utf8");
mysqli_query($db_conn, "set session character_set_connection=utf8;");
mysqli_query($db_conn, "set session character_set_results=utf8;");
mysqli_query($db_conn, "set session character_set_client=utf8;");
?>
728x90
'웹 프로그래밍 > PHP' 카테고리의 다른 글
CURL (0) | 2022.05.19 |
---|---|
유동변수 (0) | 2022.05.06 |
모바일인지 확인 (0) | 2021.11.29 |
2중배열에서 값있는지 찾기 (0) | 2021.08.04 |
전화번호 출력 정규식 (0) | 2021.04.21 |