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

  • SEARCH
  • Home
  • 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 7902781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:35:33+00:00 2026-06-03T09:35:33+00:00

I have very specific question, I cannot find a problem. I try update some

  • 0

I have very specific question, I cannot find a problem. I try update some text, and I get an error:

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 ‘=
Easter in Corfu is considered to be the most magnificent celebration in Gree’ at line 1

My code:

$arr = explode("|", $id, 2);
$id = $arr[0];
$part = $arr[1];                                                // in which part of a splited paragraph currently we are
$row = mysql_fetch_array(mysql_query("SELECT * FROM paragraph WHERE id=$id")) or die(mysql_error());    
$search = 'insertphotos';                                       // the string to search for     
$string = $row['text_content'];                                 // the string to search
$repetition = substr_count($string, $search);                   // how many insertphotos exist in paragraph
if ($repetition > $part){   
    if ($part > 1)
        $offset = $part - 1;                                    // how many times to search for word insertphotos
    else
        $offset = $part;
    $start = strposOffset($search, $string, $offset) + 13;      // find position of '$offset' occurance of search string
    $offset++;
    $end = strposOffset($search, $string, $offset) - $start - 1;
    $string = substr_replace($string, $value, $start, $end);
}else if ($repetition == $part){
    $offset = $part;                                        // how many times to search for word insertphotos
    $start = strposOffset($search, $string, $offset) + 13;      // find position of '$offset' occurance of search string
    $string = substr_replace($string, $value, $start, strlen($string)); 
}else
    $string = "<p>".$value."</p>";
//$value = "<p>".$value."</p>";
mysql_query("UPDATE paragraph SET text_content=".$string." WHERE id='$id'") or die(mysql_error());  
//mysql_query("INSERT INTO paragraph (header, text_content, menu_id, sequence) VALUES('<h2>Bella Vista Hotel h2 - Please Change Me</h2>', $string, '15', '2')") or die(mysql_error());
mysql_close($link);     
//echo "INSERT PHOTOS REPEATS " .$repetition ." ID =".$id ." PART = ".$part ." WE SEARCH, START AT " .$start ." FINISH AT " .$end ." SEARCH FOR OFFSET = " .$offset ." FINAL STRING " .$string;
echo $string;

Every variable works, I tried to echo, there is no any problem. If there is only one insertphotos (or zero) in the text it works. While I have more than one, then I get this error. I don’t have a clue why?

  • 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-03T09:35:34+00:00Added an answer on June 3, 2026 at 9:35 am

    Your text string isn’t quoted.

    mysql_query("UPDATE paragraph SET text_content='".mysql_real_escape_string($string)."' WHERE id='$id'") or die(mysql_error());
    

    You should also escape your inputs: http://php.net/manual/en/function.mysql-real-escape-string.php

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

Sidebar

Related Questions

The problem that I have is somehow very specific. I have to implement a
this is a very specific question, but i also have very specific details on
The question I have is very specific. I wanted to have an app where
I inspired by MeBigFatGuy interesting question , in this conection I have very specific
I don't have a specific question here but I'm more looking for some guidance
I have a very specific html table construct that seems to reveal a Gecko
I have a very specific set of needs and am looking for a library
I have a particular application that needs to calculate something very specific, and while
I have a custom closed-hashset/open-addressing (i.e. no linked lists) class. It's very specific to
I have a very odd issue. When I execute a specific database stored procedure

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.