2013-04-07 139 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內=‘’。 。「元素!