Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9179055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:42:05+00:00 2026-06-17T17:42:05+00:00

I get an error, Warning: preg_replace(): No ending delimiter ‘#’ found on this line,

  • 0

I get an error,

Warning: preg_replace(): No ending delimiter '#' found

on this line,

$sql = preg_replace("\n#[^\n]*\n", "\n", $sql);

on this function,

function split_sql($sql) {
    $sql = trim($sql);
    $sql = preg_replace("\n#[^\n]*\n", "\n", $sql);

    $buffer = array();
    $ret = array();
    $in_string = false;

    for($i=0; $i<strlen($sql)-1; $i++) {
        if($sql[$i] == ";" && !$in_string) {
            $ret[] = substr($sql, 0, $i);
            $sql = substr($sql, $i + 1);
            $i = 0;
        }

        if($in_string && ($sql[$i] == $in_string) && $buffer[1] != "\\") {
            $in_string = false;
        }
        elseif(!$in_string && ($sql[$i] == '"' || $sql[$i] == "'") && (!isset($buffer[0]) || $buffer[0] != "\\")) {
            $in_string = $sql[$i];
        }
        if(isset($buffer[1])) {
            $buffer[0] = $buffer[1];
        }
        $buffer[1] = $sql[$i];
    }

    if(!empty($sql)) {
        $ret[] = $sql;
    }
    return($ret);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:42:07+00:00Added an answer on June 17, 2026 at 5:42 pm

    The delimiter must be a non-alphanumeric, non-whitespace character. It is seeing the # as the delimiter for this reason, and therefore looks for another one and can’t find it.

    Try preg_replace("/\n#[^\n]*\n/","\n",$sql);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to initialize a session but i get this error: Warning: session_start() [function.session-start]:
I get the error Warning: printf() [function.printf]: Too few arguments Looking at the code
I get the following error within Magento CE 1.6.1.0 Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot
I get this warning in my error logs and wanted to know how to
I keep getting this error: Warning: preg_match() [function.preg-match]: Unknown modifier 't' in D:\xampp\htdocs\administrator\components\com_smms\functions\plugin.php on
I get the error Warning: file_get_contents(https://graph.facebook.com/me?fields=id,name,picture) [function.file-get-contents]: failed to open stream: HTTP request failed!
Here's the error: For: PHP 5.2+ Warning: strpos() [function.strpos]: Empty delimiter in /helper.php on
i have this function, and i get this error Deprecated: Function eregi() is deprecated
i get this error: Warning: Unknown: Your script possibly relies on a session side-effect
I get a Error: Warning 25: bad style, all clauses in this pattern-matching are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.