4. MySQL 데이터베이스 실습
페이지 정보
작성자 관리자 댓글 2건 조회 3,028회 작성일 21-05-03 15:33본문
4. MySQL 데이터베이스 실습
댓글목록
관리자님의 댓글
관리자 작성일
<?php
$con = mysqli_connect("localhost", "user1", "12345", "sample");
$sql = "select * from member";
$result = mysqli_query($con, $sql);
mysqli_close($con);
?>
관리자님의 댓글
관리자 작성일
create table member (
num int not null auto_increment,
id char(20) not null,
name char(20) not null,
gender char(1),
post_num char(8),
address char(80),
tel char(20),
age int,
primary key(num)
);
insert into member (id, name, gender, post_num, address, tel, age) values ('yjhwang', '황영주', 'M', '100-011', '서울시 중구 충무로1가', '234-8879', 35);
insert into member (id, name, gender, post_num, address, tel, age) values ('khshul', '설기형', 'M', '607-010', '부산시 동래구 명륜동', '764-3784', 33);
insert into member (id, name, gender, post_num, address, tel, age) values ('chpark', '박철호', 'M', '503-200', '광주시 남구 지석동', '298-9730', 34);
insert into member (id, name, gender, post_num, address, tel, age) values ('shlee', '이상훈', 'M', '503-201', '광주시 남구 도금동', '838-4347', 32);
insert into member (id, name, gender, post_num, address, tel, age) values ('jyjang', '장영숙', 'W', '606-065', '부산시 영도구 봉래동5가', '399-9809', 24);
insert into member (id, name, gender, post_num, address, tel, age) values ('yjbae', '배용진', 'M', '122-014', '서울시 은평구 응암4동', '857-5683', 30);
insert into member (id, name, gender, post_num, address, tel, age) values ('hbpark', '박혜빈', 'W', '427-760', '경기도 과천시 중앙동', '234-7677', 22);
insert into member (id, name, gender, post_num, address, tel, age) values ('mskim', '김문수', 'M', '429-020', '경기도 시흥시 신천동', '370-6003', 63);
insert into member (id, name, gender, post_num, address, tel, age) values ('bkcha', '차범길', 'M', '302-121', '대전시 서구 둔산1동', '432-9877', 49);
insert into member (id, name, gender, post_num, address, tel, age) values ('kskim', '김길수', 'M', '440-747', '경기도 수원시 장안구 파장동', '324-5875', 54);
insert into member (id, name, gender, post_num, address, tel, age) values ('srkim', '김수련', 'M', '704-701', '대구시 달서구 신당동', '987-3688', 23);
insert into member (id, name, gender, post_num, address, tel, age) values ('shlee', '이성현', 'M', '441-081', '경기도 수원시 권선구 매산로1가', '243-6844', 36);
insert into member (id, name, gender, post_num, address, tel, age) values ('hnjang', '정한나', 'W', '502-763', '광주시 서구 화정4동', '845-4547', 58);
insert into member (id, name, gender, post_num, address, tel, age) values ('mylee', '이명연', 'W', '502-791', '광주시 서구 쌍촌동', '837-9432', 33);
insert into member (id, name, gender, post_num, address, tel, age) values ('yskim', '김영숙', 'W', '429-010', '경기도 시흥시 대야동', '374-8438', 53);
insert into member (id, name, gender, post_num, address, tel, age) values ('jekim', '김정은', 'W', '503-202', '광주시 남구 원산동', '347-8873', 29);
insert into member (id, name, gender, post_num, address, tel, age) values ('yjko', '고영주', 'W', '122-020', '서울시 은평구 녹번동', '479-3874', 32);
insert into member (id, name, gender, post_num, address, tel, age) values ('cyahn', '안철영', 'M', '122-030', '서울시 은평구 대조동', '347-4687', 34);
insert into member (id, name, gender, post_num, address, tel, age) values ('jmkim', '김진모', 'M', '530-140', '전라남도 목포시 항동', '379-8349', 28);
insert into member (id, name, gender, post_num, address, tel, age) values ('ycshul', '설영찬', 'M', '606-070', '부산시 영도구 청학동', '983-8748', 41);
insert into member (id, name, gender, post_num, address, tel, age) values ('jjko', '고재진', 'M', '100-013', '서울시 중구 충무로3가', '836-4655', 28);
insert into member (id, name, gender, post_num, address, tel, age) values ('hwlee', '이현우', 'M', '606-071', '부산시 영도구 청학1동', '346-8892', 32);
insert into member (id, name, gender, post_num, address, tel, age) values ('cskang', '강찬숙', 'W', '668-890', '경상남도 남해군 설천면', '377-6879', 21);
insert into member (id, name, gender, post_num, address, tel, age) values ('ypji', '지영필', 'M', '122-040', '서울시 은평구 불광동', '366-3747', 52);
insert into member (id, name, gender, post_num, address, tel, age) values ('jbkim', '김진배', 'M', '427-600', '경기도 과천시 과천동', '382-4993', 47);
insert into member (id, name, gender, post_num, address, tel, age) values ('jepark', '박지은', 'W', '670-800', '경상남도 거창군 거창읍', '328-8743', 26);
insert into member (id, name, gender, post_num, address, tel, age) values ('jhlee', '이지현', 'W', '704-702', '대구시 달서구 월성동', '386-7988', 27);
insert into member (id, name, gender, post_num, address, tel, age) values ('bykang', '강부영', 'M', '302-120', '대전시 서구 둔산동', '798-3243', 62);
insert into member (id, name, gender, post_num, address, tel, age) values ('jymoon', '문진영', 'W', '302-122', '대전시 서구 둔산2동', '987-3248', 18);
insert into member (id, name, gender, post_num, address, tel, age) values ('jyjun', '전지연', 'W', '100-012' , '서울시 중구 충무로2가', '347-2236', 28);
insert into member (id, name, gender, post_num, address, tel, age) values ('jkko', '고진길', 'M', '122-013', '서울시 은평구 응암3동', '234-7466', 27);
insert into member (id, name, gender, post_num, address, tel, age) values ('myjung', '정명윤', 'M', '502-771', '광주시 서구 치평동', '374-8786', 47);
insert into member (id, name, gender, post_num, address, tel, age) values ('jsyou', '유지수', 'W', '502-772', '광주시 서구 치평동', '309-3897', 49);
insert into member (id, name, gender, post_num, address, tel, age) values ('dsshin', '신달성', 'W', '530-145', '전라남도 신안군 장산면', '399-8789', 53);
insert into member (id, name, gender, post_num, address, tel, age) values ('sjshin', '신수진', 'W', '606-796', '부산시 영도구 봉래동5가', '389-8930', 47);