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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:12:05+00:00 2026-06-11T02:12:05+00:00

I have a PHP MSSQL Query that worked previously, Hoever since I have changed

  • 0

I have a PHP MSSQL Query that worked previously, Hoever since I have changed an element that appears to have nothing to do with the query, it has started throwing errors.

Here is the query:

<?php 
if (isset($_POST['paper'])) {

$PageHTML = $_POST['ckeditor'];
$PageID = $_GET['id'];

$myServer = "**.***.***.**";
$myUser = "username";
$myPass = "password";
$myDB = "database";

$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer"); 
mssql_select_db($myDB) or die;

$dbTABLE = "Table_Name";
$query_sql = sprintf("UPDATE %s SET PageHTML = ('%s') WHERE PageID = '%d'",
$dbTABLE,
$PageHTML,
$PageID); 

if ($result = mssql_query($query_sql, $dbhandle)) {
header('Location: Manage.php');
}
}
?>

The errors is has started throwing are as follows:

Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near 're'.   (severity 15) in (file path) on line 59

Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark after  the character string '</p> </div> </td> </tr> </tbody> </table>') WHERE PageID = '2''.   (severity 15) in (file path) on line 59

line 59 is this line:

if ($result = mssql_query($query_sql, $dbhandle)) {

I have checked it and am using similar syntax in other areas. Can anyone see where it is wrong?

  • 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-11T02:12:07+00:00Added an answer on June 11, 2026 at 2:12 am

    You are trying to add HTML code into database and there are troubles with quotes and special symbols. Yes, u can say you’re doing sprintf(), but that function dont solve sql syntax problems. Try for example addslashes() or else sanitizing php functions.

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

Sidebar

Related Questions

I have a PHP/MySQL query that returns to an HTML table, and I'm stuck
Let's say that I have an error in a php/mysql query : $query =
I have a php script that runs a mysql query, then loops the result,
Right now I have a PHP file that does a MYSQL query and then
I have a simple query (in a mySQL view) that php is using to
I want to have a generic PHP function that builds a mysql query based
Possible Duplicate: php/Mysql query with inserting date fails I have a datepicker code below:
So i have this script: <?php $query = mysql_query( SELECT meetup AS text, id
I have the following mysql query which I am running with php like so.
We have a PHP/MYSQL application that collects user input, including special characters like ø,ü,ñ,

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.