Incorrect Syntax on Admin.php

2011-12-14
2013-05-28
  • ramayanabali
    ramayanabali
    2011-12-14

    When I attempt to Save Changes on the theme-specific admin dashboard page I get the following error:

    The WHERE clause is

    WHERE `option_name` = N'mysite_fusion_11_options'

    but should be

    WHERE option_name = N'mysite_fusion_11_options'

    WordPress database error Incorrect syntax near '`'. for query UPDATE jobblox_options SET option_value = N'a:84:{s:12:"display_logo";s:4:"true";s:8:"logo_url";s:0:"";s:11:"favicon_url";s:0:"";s:13:"intro_options";s:12:"title_teaser";s:13:"custom_teaser";s:64:"Vestibulum ante ipsum primis in faucibus orci luctus et posuere.";s:18:"custom_teaser_html";s:0:"";s:10:"twitter_id";s:0:"";s:12:"extra_header";s:0:"";s:20:"breadcrumb_delimiter";s:1:"/";s:14:"analytics_code";s:0:"";s:10:"custom_css";s:0:"";s:9:"custom_js";s:0:"";s:15:"homepage_layout";s:10:"full_width";s:20:"homepage_teaser_text";s:88:"Lorem ipsum dolor sit amet, consectetur adipiscing pretium urna quis tortor consectetur ";s:18:"teaser_button_text";s:11:"Get Started";s:13:"teaser_button";s:6:"custom";s:18:"teaser_button_page";s:0:"";s:20:"teaser_button_custom";s:30:"http://mysitemyway.com/support";s:7:"content";s:0:"";s:16:"mainpage_content";s:0:"";s:22:"homepage_footer_teaser";s:108:"Lorem ipsum dolor sit amet, consectetur adipiscing elit pretium urna quis tortor consectetur et pretium elit";s:17:"image_resize_type";s:8:"timthumb";s:25:"one_column_portfolio_full";a:2:{s:1:"w";s:3:"920";s:1:"h";s:3:"634";}s:25:"two_column_portfolio_full";a:2:{s:1:"w";s:3:"441";s:1:"h";s:3:"304";}s:27:"three_column_portfolio_full";a:2:{s:1:"w";s:3:"282";s:1:"h";s:3:"194";}s:26:"four_column_portfolio_full";a:2:{s:1:"w";s:3:"202";s:1:"h";s:3:"139";}s:26:"portfolio_single_full_full";a:2:{s:1:"w";s:3:"980";s:1:"h";s:3:"675";}s:20:"one_column_blog_full";a:2:{s:1:"w";s:3:"920";s:1:"h";s:3:"460";}s:20:"two_column_blog_full";a:2:{s:1:"w";s:3:"441";s:1:"h";s:3:"220";}s:22:"three_column_blog_full";a:2:{s:1:"w";s:3:"282";s:1:"h";s:3:"141";}s:21:"four_column_blog_full";a:2:{s:1:"w";s:3:"202";s:1:"h";s:3:"101";}s:20:"small_post_list_full";a:2:{s:1:"w";s:2:"80";s:1:"h";s:2:"80";}s:21:"medium_post_list_full";a:2:{s:1:"w";s:3:"250";s:1:"h";s:3:"285";}s:20:"large_post_list_full";a:2:{s:1:"w";s:3:"601";s:1:"h";s:3:"373";}s:26:"additional_posts_grid_full";a:2:{s:1:"w";s:3:"237";s:1:"h";s:3:"164";}s:24:"one_column_portfolio_big";a:2:{s:1:"w";s:3:"660";s:1:"h";s:3:"455";}s:24:"two_column_portfolio_big";a:2:{s:1:"w";s:3:"317";s:1:"h";s:3:"217";}s:26:"three_column_portfolio_big";a:2:{s:1:"w";s:3:"202";s:1:"h";s:3:"139";}s:25:"four_column_portfolio_big";a:2:{s:1:"w";s:3:"145";s:1:"h";s:3:"100";}s:25:"portfolio_single_full_big";a:2:{s:1:"w";s:3:"660";s:1:"h";s:3:"455";}s:19:"one_column_blog_big";a:2:{s:1:"w";s:3:"660";s:1:"h";s:3:"330";}s:19:"two_column_blog_big";a:2:{s:1:"w";s:3:"317";s:1:"h";s:3:"158";}s:21:"three_column_blog_big";a:2:{s:1:"w";s:3:"202";s:1:"h";s:3:"101";}s:20:"four_column_blog_big";a:2:{s:1:"w";s:3:"145";s:1:"h";s:2:"72";}s:19:"small_post_list_big";a:2:{s:1:"w";s:2:"80";s:1:"h";s:2:"80";}s:20:"medium_post_list_big";a:2:{s:1:"w";s:3:"250";s:1:"h";s:3:"285";}s:19:"large_post_list_big";a:2:{s:1:"w";s:3:"431";s:1:"h";s:3:"267";}s:25:"additional_posts_grid_big";a:2:{s:1:"w";s:3:"172";s:1:"h";s:3:"118";}s:26:"one_column_portfolio_small";a:2:{s:1:"w";s:3:"690";s:1:"h";s:3:"475";}s:26:"two_column_portfolio_small";a:2:{s:1:"w";s:3:"331";s:1:"h";s:3:"228";}s:28:"three_column_portfolio_small";a:2:{s:1:"w";s:3:"211";s:1:"h";s:3:"145";}s:27:"four_column_portfolio_small";a:2:{s:1:"w";s:3:"151";s:1:"h";s:3:"104";}s:27:"portfolio_single_full_small";a:2:{s:1:"w";s:3:"690";s:1:"h";s:3:"475";}s:21:"one_column_blog_small";a:2:{s:1:"w";s:3:"690";s:1:"h";s:3:"345";}s:21:"two_column_blog_small";a:2:{s:1:"w";s:3:"331";s:1:"h";s:3:"165";}s:23:"three_column_blog_small";a:2:{s:1:"w";s:3:"211";s:1:"h";s:3:"105";}s:22:"four_column_blog_small";a:2:{s:1:"w";s:3:"151";s:1:"h";s:2:"75";}s:21:"small_post_list_small";a:2:{s:1:"w";s:2:"50";s:1:"h";s:2:"50";}s:22:"medium_post_list_small";a:2:{s:1:"w";s:3:"250";s:1:"h";s:3:"285";}s:21:"large_post_list_small";a:2:{s:1:"w";s:3:"450";s:1:"h";s:3:"279";}s:27:"additional_posts_grid_small";a:2:{s:1:"w";s:3:"180";s:1:"h";s:3:"124";}s:15:"homepage_slider";s:13:"fading_slider";s:11:"nivo_effect";s:0:"";s:11:"nivo_slices";s:0:"";s:15:"nivo_anim_speed";s:0:"";s:12:"slider_speed";s:4:"4000";s:17:"slider_fade_speed";s:4:"slow";s:10:"slider_nav";s:4:"dots";s:18:"nivo_direction_nav";s:12:"button_hover";s:13:"slider_custom";s:6:"custom";s:16:"slider_cat_count";s:0:"";s:9:"slideshow";a:7:{i:1;a:6:{s:10:"slider_url";s:83:"http://localhost/jobbloxwp/wp-content/themes/fusion_11/images/activation/staged.jpg";s:8:"alt_attr";s:0:"";s:8:"link_url";s:0:"";s:5:"title";s:0:"";s:12:"stage_effect";s:12:"staged_slide";s:11:"description";s:0:"";}i:2;a:6:{s:10:"slider_url";s:97:"http://localhost/jobbloxwp/wp-content/themes/fusion_11/images/activation/partial_staged_slide.jpg";s:8:"alt_attr";s:0:"";s:8:"link_url";s:22:"http://mysitemyway.com";s:5:"title";s:0:"";s:12:"stage_effect";s:21:"partial_staged_slideL";s:11:"description";s:205:"Proin volutpat fermentum purus sed varius. Nullam interdum massa a libero mattis et accumsan diam pulvinar. Aenean dui est, feugiat nec sagittis ut, lobortis non tellus. Nam id erat a lacus sagittis tempor";}i:3;a:6:{s:10:"slider_url";s:99:"http://localhost/jobbloxwp/wp-content/themes/fusion_11/images/activation/partial_gradient_slide.jpg";s:8:"alt_attr";s:0:"";s:8:"link_url";s:22:"http://mysitemyway.com";s:5:"title";s:0:"";s:12:"stage_effect";s:22:"partial_gradient_slide";s:11:"description";s:201:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum faucibus consequat tellus non vestibulum. Phasellus tortor mi, faucibus sit amet ullamcorper nec";}i:4;a:6:{s:10:"slider_url";s:85:"http://localhost/jobbloxwp/wp-content/themes/fusion_11/images/activation/floating.jpg";s:8:"alt_attr";s:0:"";s:8:"link_url";s:0:"";s:5:"title";s:0:"";s:12:"stage_effect";s:14:"floating_slide";s:11:"description";s:0:"";}i:5;a:6:{s:10:"slider_url";s:81:"http://localhost/jobbloxwp/wp-content/themes/fusion_11/images/activation/full.jpg";s:8:"alt_attr";s:0:"";s:8:"link_url";s:0:"";s:5:"title";s:0:"";s:12:"stage_effect";s:10:"full_slide";s:11:"description";s:0:"";}s:1:"#";a:6:{s:10:"slider_url";s:0:"";s:8:"alt_attr";s:0:"";s:8:"link_url";s:0:"";s:5:"title";s:0:"";s:12:"stage_effect";s:12:"staged_slide";s:11:"description";s:0:"";}s:11:"slider_keys";s:11:"1,2,3,4,5,#";}s:9:"blog_page";s:0:"";s:11:"blog_layout";s:12:"blog_layout1";s:16:"post_like_module";s:3:"tab";s:19:"post_comment_styles";s:3:"tab";s:11:"bitly_login";s:0:"";s:9:"bitly_api";s:0:"";s:14:"footer_columns";s:1:"6";s:13:"footer_teaser";s:108:"Lorem ipsum dolor sit amet, consectetur adipiscing elit pretium urna quis tortor consectetur et pretium elit";s:11:"footer_text";s:61:"&copy; <a href=\"[http://mysitemyway.com](http://mysitemyway.com%5C)">mysitemyway.com</a>";s:8:"sociable";a:2:{s:1:"#";a:4:{s:4:"icon";s:13:"delicious.png";s:5:"color";s:14:"black_cameleon";s:6:"custom";s:0:"";s:4:"link";s:0:"";}s:4:"keys";s:1:"#";}s:14:"admin_logo_url";s:0:"";s:14:"import_options";s:0:"";}' WHERE `option_name` = N'mysite_fusion_11_options' made by do_action, call_user_func_array, mysite_options_init, mysite_ajax_option_save, update_option, sqlsrv_wpdb->query, sqlsrv_wpdb->_post_query, sqlsrv_wpdb->print_error

     
  • OmniTI
    OmniTI
    2011-12-21

    It appears that something is being incorrectly quoted - which extension are you using (pdo_sqlsrv, mssql)

    Can you turn on query logging in your wp-config.php file?

     
  • ramayanabali
    ramayanabali
    2011-12-22

    Dear Omniti

    Thanks for your response.

    MS SQL Server 2008, php_sqlsrv_53_nts_vc9.dll.

    Turning on query logging is a good idea.  I did not know I could do that.

    As it turns out the source of the issue does come from the initialization of the options by the theme.  I accidentally discovered this when my local environment started saving the options correctly without error.  When I reset the options to the default for the theme the error returned.  So I set all the theme options to '' and this eliminated the error (caused by some theme option setting that was causing the incorrect quoting somewhere along the line) and allowed me to save the theme options.  The solution is kind of brute force but it eliminates my immediate issue and allows me to use the theme's admin panel.  I don't know whether it warrants any further research, i.e. there does appear to be some issue along the way because this is a query that works fine in MySQL but when passed to the SQL Server Driver for PHP something ends up being misquoted and causing a syntax error.

    Please let me know if you have any questions.

    Thanks

    Chad

     
  • Mike Grant
    Mike Grant
    2012-01-09

    I have this same problem with the incorrect syntax due to the "`".

    But I'm experiencing it with 2 plugins, wp-table-reloaded and widget_logic. Anyone else had some similar problems with it or similar plugins?

    Hope someone can let me know.