1. <?php
  2.   $mysql_con = mysql_connect("localhost", "test1", "test1") 
  3.                          or die("mysql_connect false : db info confirmation demand");
  4.   
  5.   if($mysql_con) echo "연결 성공";
  6.   
  7.   // 연결 성공
  8.   
  9.   /*연결 실패시 Warning메세지와 함께 die()함수 안 문자열 출력
  10.     mysql_connect false : db info confirmation demand
  11.   */
  12. ?>

--------------------------------------------------------------------------------------------


resource mysql_connect ([ string $server = ini_get("mysql.default_host") [, string $username = ini_get("mysql.default_user") [, string $password = ini_get("mysql.default_password") [, bool $new_link = false [, int $client_flags = 0 ]]]]] )


2. 라인

mysql 서버 연결되면 resource을 반환합니다.

연결 실패시  Warning 메세지가 출력됩니다.


or die("출력할 문자열");를 추가로 넣으면

    연결 실패시 출력할 문자열이 나옵니다.

:
BLOG main image

공지사항

카테고리

분류 (356)
main (1)
php5 (218)
HTML (36)
javascript (93)
IT 이론과 퍼온정보 (8)
깨작일상 (0)
곧 추가할 내용 (0)
추후 알아볼것들... (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

달력

«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Total :
Today : Yesterday :