SQL 실행방법.
본문
CREATE TABLE `card_bet` (
`cb_idx` int(11) NOT NULL,
`cb_mb_id` varchar(20) NOT NULL,
`cb_time` varchar(10) NOT NULL,
`cb_date` varchar(25) NOT NULL,
`cb_episode` int(11) NOT NULL DEFAULT '0',
`cb_batting_date` varchar(255) NOT NULL,
`cb_character_no` int(11) NOT NULL DEFAULT '0',
`cb_rate` float NOT NULL DEFAULT '0',
`cb_batting_point` int(11) NOT NULL DEFAULT '0',
`cb_gain_point` int(11) NOT NULL DEFAULT '0',
`cb_result` int(11) NOT NULL DEFAULT '0',
`cb_win` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `card_bet`
ADD PRIMARY KEY (`cb_idx`),
ADD KEY `cb_result` (`cb_result`),
ADD KEY `cb_episode` (`cb_episode`),
ADD KEY `cb_date` (`cb_date`),
ADD KEY `cb_character_no` (`cb_character_no`),
ADD KEY `cb_mb_id` (`cb_mb_id`),
ADD KEY `cb_time` (`cb_time`);
ALTER TABLE `card_bet`
MODIFY `cb_idx` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT;
----------------------------------------------------------------------------------------------------------------------------
--
-- Table structure for table `g5_result_poker`
--
CREATE TABLE `g5_result_poker` (
`poker_idx` int(11) NOT NULL,
`poker_timeId` int(11) NOT NULL,
`poker_datetime` varchar(25) NOT NULL,
`poker_episode_date` varchar(10) NOT NULL,
`poker_episode` int(11) NOT NULL,
`poker_card` varchar(255) NOT NULL,
`poker_player_card` varchar(255) NOT NULL,
`poker_result_id` varchar(255) NOT NULL,
`poker_result_card` varchar(255) NOT NULL,
`poker_result_rank` varchar(255) NOT NULL,
`poker_status` int(11) NOT NULL DEFAULT '1',
`poker_oddx1` decimal(3,2) NOT NULL,
`poker_oddx2` decimal(3,2) NOT NULL,
`poker_oddx3` decimal(3,2) NOT NULL,
`poker_oddx4` decimal(3,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `g5_result_poker`
--
--
-- Indexes for dumped tables
--
--
-- Indexes for table `g5_result_poker`
--
ALTER TABLE `g5_result_poker`
ADD PRIMARY KEY (`poker_idx`),
ADD KEY `poker_episode_date` (`poker_episode_date`),
ADD KEY `poker_episode` (`poker_episode`),
ADD KEY `poker_status` (`poker_status`),
ADD KEY `poker_timeId` (`poker_timeId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `g5_result_poker`
--
ALTER TABLE `g5_result_poker`
MODIFY `poker_idx` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT;
플러그인의 게임을 다운받았는데요.
이걸 실행시켜야된다고 해서 PHPMYADMIN -> SQL에 이 소스를 넣고 실행시키니 오류가 나더라구요.
파일로 불러와도 반응이 없구요...
이 SQL을 실행시키려면 어떻게 하면 되나요?
답변 3
CREATE TABLE card_bet (
cb_idx int(11) NOT NULL,
cb_mb_id varchar(20) NOT NULL,
cb_time varchar(10) NOT NULL,
cb_date varchar(25) NOT NULL,
cb_episode int(11) NOT NULL DEFAULT '0',
cb_batting_date varchar(255) NOT NULL,
cb_character_no int(11) NOT NULL DEFAULT '0',
cb_rate float NOT NULL DEFAULT '0',
cb_batting_point int(11) NOT NULL DEFAULT '0',
cb_gain_point int(11) NOT NULL DEFAULT '0',
cb_result int(11) NOT NULL DEFAULT '0',
cb_win int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE card_bet
ADD PRIMARY KEY (cb_idx),
ADD KEY cb_result (cb_result),
ADD KEY cb_episode (cb_episode),
ADD KEY cb_date (cb_date),
ADD KEY cb_character_no (cb_character_no),
ADD KEY cb_mb_id (cb_mb_id),
ADD KEY cb_time (cb_time);
ALTER TABLE card_bet
MODIFY cb_idx int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT;
CREATE TABLE g5_result_poker (
poker_idx int(11) NOT NULL,
poker_timeId int(11) NOT NULL,
poker_datetime varchar(25) NOT NULL,
poker_episode_date varchar(10) NOT NULL,
poker_episode int(11) NOT NULL,
poker_card varchar(255) NOT NULL,
poker_player_card varchar(255) NOT NULL,
poker_result_id varchar(255) NOT NULL,
poker_result_card varchar(255) NOT NULL,
poker_result_rank varchar(255) NOT NULL,
poker_status int(11) NOT NULL DEFAULT '1',
poker_oddx1 decimal(3,2) NOT NULL,
poker_oddx2 decimal(3,2) NOT NULL,
poker_oddx3 decimal(3,2) NOT NULL,
poker_oddx4 decimal(3,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE g5_result_poker
ADD PRIMARY KEY (poker_idx),
ADD KEY poker_episode_date (poker_episode_date),
ADD KEY poker_episode (poker_episode),
ADD KEY poker_status (poker_status),
ADD KEY poker_timeId (poker_timeId);
ALTER TABLE g5_result_poker
MODIFY poker_idx int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT;
이것으로 SQL에 넣고 실행해보세요.
dbms에 phpmyadmin sql실행기에 넣으시면 어느구문에서 오류나는지 확인이 되실거예요
그부분에서 처리하시면 되고 부분은 문법오류가 많으니 작게 나눠서 해보시는게 좋습니다.
sql 문에서 두군데 혹은
CHARSET=latin1;
=>
CHARSET=utf8;
로 바꾸시고
;
단위로만 실행해보시면
좀 낫지 않을까 싶습니다.