2010-04-30 52 views
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 ')' at line 1 

INSERT INTO `jos_menu` SET params = 'orderby= show_noauth= show_title= link_titles= show_intro= show_section= link_section= show_category= link_category= show_author= show_create_date= show_modify_date= show_item_navigation= show_readmore= show_vote= show_icons= show_pdf_icon= show_print_icon= show_email_icon= show_hits= feed_summary= page_title= show_page_title=1 pageclass_sfx= menu_image=-1 secure=0 ', checked_out_time = '0000-00-00 00:00:00', ordering = '13', componentid = '20', published = '1', id = '152', menutype = 'accmenu', name = 'IPL', alias = 'ipl', link = 'index.php?option=com_content&view=archive', type = 'component') 

然後我用在含有查詢變量mysql_real_escape_string(),它給我的查詢作爲:

INSERT INTO `jos_menu` SET params = \'orderby=\nshow_noauth=\nshow_title=\nlink_titles=\nshow_intro=\nshow_section=\nlink_section=\nshow_category=\nlink_category=\nshow_author=\nshow_create_date=\nshow_modify_date=\nshow_item_navigation=\nshow_readmore=\nshow_vote=\nshow_icons=\nshow_pdf_icon=\nshow_print_icon=\nshow_email_icon=\nshow_hits=\nfeed_summary=\npage_title=\nshow_page_title=1\npageclass_sfx=\nmenu_image=-1\nsecure=0\n\n\', checked_out_time = \'0000-00-00 00:00:00\', ordering = \'13\', componentid = \'20\', published = \'1\', id = \'152\', menutype = \'accmenu\', name = \'IPL\', alias = \'ipl\', link = \'index.php?option=com_content&view=archive\', type = \'component\') 

而上執行上述查詢我得到一個錯誤爲:

> #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 
> '\'orderby=\nshow_noauth=\nshow_title=\nlink_titles=\nshow_intro=\nshow_section=\' at line 1 

有人可以指導我跟蹤其中的問題嗎?

在此先感謝....

+2

你已經結束了)並且沒有開始,你能提供完整的代碼行嗎? – Jonathan 2010-04-30 05:47:36

+0

感謝U Mate !!!我想你的建議在答案欄標記爲接受... – 2010-04-30 05:50:57

回答

3

您在查詢的末尾有一個無與倫比)

+0

+1 Duh。 RTF錯誤信息! – 2010-04-30 05:50:15