HOME 개발팁 [보안] MYSQL_PHP

프로그램 작업하다 좋은 팁, 정보, 테스트를 기록하는 곳입니다.


SQL | [보안] MYSQL_PHP

페이지 정보

작성자 굿스웹 작성일19-03-19 16:23 조회906회 댓글0건

본문

<?php
/* 접속하고, 데이터베이스를 선택 */
$link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
  or die("접속할 수 없습니다 : " . mysql_error());
echo "접속 성공";
mysql_select_db("my_database") or die("데이터베이스를 선택할 수 없습니다.");



/* SQL 쿼리 실행하기 */
$query = "SELECT * FROM my_table";
$result = mysql_query($query) or die("쿼리 실패 : " . mysql_error());



/* HTML로 결과 출력하기 */
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  echo "\t<tr>\n";
  foreach ($line as $col_value) {
      echo "\t\t<td>$col_value</td>\n";
  }
  echo "\t</tr>\n";
}
echo "</table>\n";


/* 결과셋 해제하기 */
mysql_free_result($result);

/* 접속 종료 */
mysql_close($link);
?>


차례
mysql_affected_rows -- 최근 MySQL 작업으로 처리된 행(row) 개수를 얻음
mysql_change_user --  현 접속에서 로그인된 사용자를 변경
mysql_client_encoding -- 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

[주소복사] https://www.goodsweb.kr/?u=D41VbMb
SNS 알리기
핀터레스트
텔레그램로
블로그로
카카오스토리
카톡 공유

관련 블로그
로딩중


6명  IP : 3.17.♡.60
001 1.♡.239.111 오류안내 페이지
(/bbs/write.php?bo_table=tip)
002 34.♡.82.75 WINDOWS APACHE 설정중.. 오류메시지처리방법 - 개발팁
(/bbs/board.php?bo_table=tip&wr_id=17)
003 40.♡.167.35 시큐리티 경호원 - 웹,앱
(/bbs/board.php?bo_table=develop&wr_id=54)
004 3.♡.23.176 홋카이도(북해도) 비에이 #2 - 갤러리
(/bbs/board.php?bo_table=photo&wr_id=11)
005 47.♡.60.140 오류안내 페이지
(/bbs/download.php?bo_table=tip&no=1&sca=%EC%A0%95%EB%B3%B4&wr_id=234)
006 3.♡.51.241 소개
(/bbs/content.php?co_id=company)

접속자
  • 오늘 : 128
  • 어제 : 355
  • 최대 : 874
  • 전체 : 399,379

검색로봇(Robots) 최근 방문시간
  • NAVER : 3시간 전
  • GOOGLE : 11시간 전
  • BING : 1일 전
  • DAUM : 4일 전

ETH : 0x8abf3B748ab78828AE07685e4fd53d1a606f18D3



페이스북 네이버 블로그 굿스웹 쇼핑몰 네이버 카페 굿스웹 트위터 굿스웹 티스토리 Google Play