2013-04-07 278 views
0

我收到以下错误,同时运行我的代码,如何自动填充mysql数据库?

INSERT INTO widgets (id , page , location , title , content , global) VALUES right(1, '/', '', 'Welcome to Animal Rights Pakistan', '

Animal Rights Pakistan is a collaboratively edited question and answer site built to suit your needs.

\r\n\r\n

It''s easy to use, with no registration required!

\r\n\r\n

co/questions/ask">ask a question

', 1);

错误:

#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 'right(1, '/', '', 'Welcome to Animal Rights Pakistan', '<p>Animal Rights Pakista' at line 1 

在此先感谢。

+0

尝试不带'正确'的查询〜 – goseo 2013-04-07 10:19:25

+0

VALUES right应该是VALUES – Bart 2013-04-07 10:19:42

回答

1

尝试没有价值后,“正确”:

INSERT INTO widgets (id, page, location, title, content, global) 
VALUES(1, '/', '', 'Welcome to Animal Rights Pakistan', 
'Animal Rights Pakistan is a collaboratively edited question and answer site built to suit your needs.\r\n\r\n. It''s easy to use, with no registration required!', 1); 

,并显示链接你最好添加一个申请到被称为“参考”表和回声它的“A HREF内=‘’。 。“元素!