만들면서 배우는 CodeIgniter Q&A

제목 초보자 문의 입니다. 4과 게시판 테이블 만들기 관련
글쓴이 jkl 작성시각 2014/08/31 17:45:55
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 8062   RSS
책에나온 코드그대로 연습중인데 테이블을 생성하면 아래와 같은 에러가 나옵니다.

ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''ci_board' (
'board_id' int(10) null auto_increment,
'board_pid' int(10) null de' at line 1
SQL Statement:
create Table 'ci_board' (
'board_id' int(10) null auto_increment,
'board_pid' int(10) null default '0' comment '원글 번호',
'user_id' varchar(20) null comment '작성자ID',
'user_name' varchar(20) not null comment '작성자 이름',
'subject' varchar(50) not null comment '게시글 제목',
'contents' text not null comment '게시글 내용',
'hits' int(10) not null comment '조회수',
'reg_date' datetime not null comment '등록일',
primary key ('board_id'),
index 'board_pid' ('board_pid')
)
comment = 'CodeIgniter 게시판'
collate = 'utf8_general_ci'
engine = MyISAM


어떻게 해결해야 하나요???
 다음글 135페이지 내용중에 post() 함수가 언디파인드 펑... (3)
 이전글 p126 글쓰기 질문드려요 (2)

댓글

변종원(웅파) / 2014/09/01 12:02:28 / 추천 0
책 다시 잘 보세요. 작은 따옴표가 아닙니다. `(키보드 1의 왼쪽)와 '(엔터키 왼쪽) 을 구분하셔야 합니다.

아니면 아래 처럼 하면 됩니다.
 

create table ci_board (

board_id int(10) not null auto_increment,

board_pid int(10) null default '0' comment '원글 번호',

user_id varchar(20) null comment '작성자ID',

user_name varchar(20) not null comment '작성자 이름',

subject varchar(50) not null comment '게시글 제목',

contents text not null comment '게시글 내용',

hits int(10) not null comment '조회수',

reg_date datetime not null comment '등록일',

primary key (board_id),

index board_pid (board_pid)

)

comment = 'CodeIgniter 게시판'

collate = 'utf8_general_ci'

engine = MyISAM