WP Db Abstraction
Tick symbol (`) showing in sql queries (3 posts)

  1. LukeG84
    Posted 2 years ago #

    I'm having an issue creating a post. I first tried to create the post from Windows Live Writer, but was getting an error. I ran SQL profiler and found there were tick symbols (`) in the query still (see sample below):
    post_content_filtered = N'', post_title = N'TEST', post_excerpt = N'', post_status = N'draft', post_type = N'post', comment_status = N'open', ping_status = N'open', post_password = N'', post_name = N'', to_ping = N'', pinged = N'', post_modified = N'2012-07-24 16:51:54', post_modified_gmt = N'2012-07-24 16:51:54', post_parent = 0, menu_order = 0, guid = N'http://xxxx/?p=358' WHERE ID = 358

    Warning: Cannot modify header information - headers already sent by (output started at C:\Sites\xxxx\wp-content\mu-plugins\wp-db-abstraction\drivers\sqlsrv.php:292) in C:\Sites\xxxx\wp-includes\pluggable.php on line 881

    I am guessing it has something to do with the content in my post because I normally do not have this issue. My post contains C# and PowerShell syntax. Any ideas on how to fix the issue would be appreciated.


  2. LukeG84
    Posted 2 years ago #

    Posting the PowerShell code in the blog post works. It has to be the C# code. Here is a sample chunk that reproduces the error.

    private void BackupWebConfigs(SPWebApplication webApp)
    foreach (KeyValuePair<SPUrlZone, SPIisSettings> pair in webApp.IisSettings)
    SPIisSettings iisSettings = pair.Value as SPIisSettings;
    string webConfigFolderPath = iisSettings.Path.FullName;
    string webConfigFilePath = webConfigFolderPath
    + "\\web.config";
    // result similar to web2011_2_1_19_24_14.bak
    string webConfigBackupFilePath = webConfigFolderPath
    + "\\web"
    + DateTime.Now.Year.ToString() + "_"
    + DateTime.Now.Month.ToString() + "_"
    + DateTime.Now.Day.ToString() + "_"
    + DateTime.Now.Hour.ToString() + "_"
    + DateTime.Now.Minute.ToString() + "_"
    + DateTime.Now.Second.ToString()
    + ".bak";
    System.Xml.Linq.XDocument webConfig =
    { }

  3. LukeG84
    Posted 2 years ago #

    Located the specific problem, but haven't researched how to fix it yet. The problem arises when you have two backslashes in your post. The characters '\\' will somehow break the sql translation so the php code never completes replacing the tick (`) symbols in the SQL query. Which causes the general SQL exception.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Db Abstraction
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.