반응형

회원Table 생성

create table tb_user(

user_id VARCHAR(20) NOT NULL PRIMARY KEY,

user_pw VARCHAR(30) NOT NULL,

user_name VARCHAR(10) NOT NULL,

user_level VARCHAR(10) NOT NULL,

user_email VARCHAR(30) NOT NULL,

user_phone VARCHAR(30) NOT NULL,

user_addre VARCHAR(60) NOT NULL,

user_birth int(10) NOT NULL,

user_gender char(2) NOT NULL,

user_joindate datetime

);


회원가입 처리

INSERT INTO tb_user (user_id, user_pw, user_name, user_level, user_email, user_phone, user_addre, user_birth, user_gender, user_joindate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())

페이징

-총 컬럼 수

select count(*) from tb_user

리스트

select * from tb_user limit 0, 10;

-10개의 컬럼만 보여준다.

수정화면

select * from tb_user where user_id= 'get_id'

수정 처리

UPDATE tb_user SET user_pw=?, user_name=?, user_level=?, user_email=?, user_phone=?, user_addre=?, user_birth=?, user_gender=?, user_grade=?, user_mileage=? WHERE user_id = ?

삭제처리

DELETE FROM tb_user WHERE user_id=?



반응형

+ Recent posts