LXIII. MySQL 함수

아래 함수들은 MySQL 데이터베이스 서버에 접근할 수 있게 해준다. 이들 함수를 사용하려면 PHP를 --with-mysql 인자를 사용하여 컴파일해야 한다. 만일 위의 인자를 설치된 MySQL의 경로 없이 사용한다면, PHP는 내장된 클라이언트 라이브러리를 대신 사용할 것이다. 서로 다른 어플리케이션을 이용하는 사용자들이 MySQL을 사용하려 할 때(예를들어, PHP3와 PHP4가 동시에 apache 모듈로써 돌아가거나, auth-mysql일 경우) MySQL 경로를 반드시 다음과 같이 설정해야 한다: --with-mysql=/path/to/mysql. 위 옵션은 php가 MySQL에 의해 설치된 클라이언트 라이브러리를 사용하도록 하며, 어떠한 충돌도 피할 수 있게 해준다.

MySQL에 대한 더 상세한 정보는 http://www.mysql.com/에서 얻을 수 있다.

MySQL 문서는 http://www.mysql.com/documentation/에 있다.

차례
mysql_affected_rows -- 최근 MySQL 작업으로 처리된 행(row) 개수를 얻음
mysql_change_user --  현 접속에서 로그인된 사용자를 변경
mysql_character_set_name -- Returns the name of the character set
mysql_close -- MySQL 접속을 닫음
mysql_connect -- MySQL 서버에 접속
mysql_create_db -- MySQL 데이터베이스를 생성
mysql_data_seek -- 내부적인 결과 포인터를 이동
mysql_db_name -- 데이터 결과를 얻음
mysql_db_query -- MySQL 질의문을 전송
mysql_drop_db -- MySQL 데이터베이스를 삭제
mysql_errno -- 최근 MySQL 작업으로 발생한 에러 번호를 반환
mysql_error -- 최근 실행된 MySQL 작업으로 발생한 에러 메시지를 반환
mysql_escape_string --  Escapes a string for use in a mysql_query.
mysql_fetch_array --  결과를 필드이름 색인 또는 숫자 색인으로 된 배열로 반환
mysql_fetch_assoc --  결과를 필드이름 색인으로 된 배열로 반환
mysql_fetch_field --  결과로부터 열 정보를 얻어서 객체로 반환
mysql_fetch_lengths --  결과로부터 각 출력의 길이를 반환
mysql_fetch_object -- 행(row)의 결과를 객체로 얻음
mysql_fetch_row -- 결과를 숫자색인으로 된 배열로 반환
mysql_field_flags --  결과로부터 특정 필드(field)의 상태정보(flag)를 반환
mysql_field_len --  특정 필드의 길이를 반환
mysql_field_name --  결과로부터 특정 필드 이름을 반환
mysql_field_seek --  특정 필드의 오프셋(offset)으로 위치(pointer)를 이동
mysql_field_table --  특정 필드가 속한 테이블 이름을 얻음
mysql_field_type --  결과로부터 특정 필드의 데이터 형(type) 정보를 반환
mysql_free_result -- Free result memory
mysql_get_client_info -- Get MySQL client info
mysql_get_host_info -- Get MySQL host info
mysql_get_proto_info -- Get MySQL protocol info
mysql_get_server_info -- Get MySQL server info
mysql_info --  Get information about the most recent query
mysql_insert_id --  최근 INSERT 작업으로부터 생성된 identifier 값을 반환
mysql_list_dbs --  MySQL 서버에 있는 데이터베이스 이름을 반환
mysql_list_fields -- MySQL 결과의 필드 리스트로 반환
mysql_list_processes -- List MySQL processes
mysql_list_tables -- MySQL 데이터베이스에 있는 테이블 목록을 반환
mysql_num_fields -- 결과로부터 필드 개수를 반환
mysql_num_rows -- 결과로부터 열 개수를 반환
mysql_pconnect --  MySQL 서버와 영구적인 데이터베이스 접속
mysql_ping -- Ping a server connection or reconnect if there is no connection
mysql_query -- Send a MySQL query
mysql_real_escape_string --  Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection.
mysql_result -- 결과 데이터를 반환
mysql_select_db -- MySQL 데이터베이스를 선택
mysql_stat -- Get current system status
mysql_tablename -- 필드의 테이블이름을 얻음
mysql_thread_id -- Return the current thread ID
mysql_unbuffered_query --  Send an SQL query to MySQL, without fetching and buffering the result rows