insert Query is not executing, help me in tracking the problem

Posted by Parth on Stack Overflow See other posts from Stack Overflow or by Parth
Published on 2010-04-30T05:43:47Z Indexed on 2010/04/30 5:47 UTC
Read the original article Hit count: 298

Filed under:
|
|

I tried the below query but it didnt executed giving error as :

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')

then i used mysql_real_escape_string() on the query containing variable which gives me the query as :

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\')

And on executing the above query I get an error as :

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

Can Someone guide me to track the problem in it?

Thanks In Advance....

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql