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 9064537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:16:49+00:00 2026-06-16T16:16:49+00:00

I was trying to update my website content by a pop up window. I

  • 0

I was trying to update my website content by a pop up window. I made the content appear according to the ID but when I try to submit it an error appears on the pop up

An error occurred upon executing query.
Please notify the web developer about this error.

NOTE: 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 ‘WHERE textID=16’ at line 1

and I can’t seem to find the bug. Can you see it?

Here’s my complete code:

    <!-- PHP -->
<?
    include('global.php');

    if(isset($_REQUEST['textID']))
        $textID = $_REQUEST['textID'];      
    if(isset($_REQUEST['textContent']))
        $textContent = $_REQUEST['textContent'];

            if($_POST){
            $query = "UPDATE text_tb SET ";
            $query = $query."textContent='".$textContent."', ";
            $query = $query."WHERE textID=".$textID.""; 
            //echo $query;
            ExecuteQuery($query);
            echo "<script type=\"text/javascript\">
                <!--
                window.close();
                //-->
                </script>";
            }
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",

        // Theme options
        theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "bullist,numlist,|,undo,redo,|,link,unlink,|,forecolor",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title : 'Bold text', inline : 'b'},
            {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
            {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
            {title : 'Example 1', inline : 'span', classes : 'example1'},
            {title : 'Example 2', inline : 'span', classes : 'example2'},
            {title : 'Table styles'},
            {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
        ],
    });
</script>
<!-- /TinyMCE -->

</head>
<body role="application">

<form method="post" action="<?php $_PHP_SELF ?>">
    <div>
                <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
        <div>
            <textarea id="textContent" name="textContent" rows="15" cols="80" style="width: 80%">
            <?
            $result = mysql_query("SELECT * FROM text_tb WHERE textID ='".$textID."'");
                                while($row = mysql_fetch_array($result)){
                                    echo $row['textContent'];
                                }
            ?>
            </textarea>
        </div>

        <!-- Some integration calls
        <a href="javascript:;" onclick="tinyMCE.get('textContent').show();return false;">[Show]</a>
        <a href="javascript:;" onclick="tinyMCE.get('textContent').hide();return false;">[Hide]</a>-->
        <br />
        <input type="submit" name="save" value="Submit" />
        <input type="reset" name="reset" value="Reset" />
    </div>
</form>

<!--<script type="text/javascript">
if (document.location.protocol == 'file:') {
    alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>-->
</body>
</html>
  • 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-16T16:16:50+00:00Added an answer on June 16, 2026 at 4:16 pm

    The problem is the comma at the end of the set. Change this line:

            $query = $query."textContent='".$textContent."', ";
    

    to:

            $query = $query."textContent='".$textContent."' ";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am having trouble trying to upload an image to a website, and update
I trying to update a model on a callback but the validation is causing
I'm trying to update a spreadsheet on a website with a jQuery ajax call
I'm updating a few sections in a website with Ajax, but now i'm trying
I'm trying to get the content of a url with file_get_contents() like this: file_get_contents('http://www.website.com');
I'm trying to update the Joomla version on one of the website I managed.
I'm trying to ping Google when my web site's sitemap is updated but I
I am trying update my version of sqlite3 on mac os x 10.5.7 I
I am trying update text views while this loop is processing. Here is my
Im trying to update a table with the following code. If I change WHERE

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.