2014-04-09 5 views
0

Я triing учебник блог из поваренной книгиCakePHP ошибки блог учебник ти MySQL сейчас()

CREATE TABLE posts (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, 
title VARCHAR(50), 
body TEXT, 
created DATETIME DEFAULT NULL, 
modified DATETIME DEFAULT NULL 
); 

Но когда я ввожу значение, которые он дал мне

INSERT INTO posts (title,body,created) 
VALUES (’The title’, ’This is the post body.’, NOW()); 
INSERT INTO posts (title,body,created) 
VALUES (’A title once again’, ’And the post body follows.’, NOW()); 
INSERT INTO posts (title,body,created) 
VALUES (’Title strikes back’, ’This is really exciting! Not.’, NOW()); 

Я получаю сообщение об ошибке

#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 'title’, ’This is the post body.’, NOW())' at line 2 

ответ

1

правильный формат

INSERT INTO posts 
(
title,body,created 
) 
VALUES 
(
'The title', 'This is the post body.', NOW() 
); 

http://sqlfiddle.com/#!2/2796d

+0

ТНХ человек это действительно работает – MahmoudSenSei

Смежные вопросы