Warning:mssql_query () [Function.mssql-query]: message:line 14:incorrect syntax near ' none '. (severity) in function.php on line 22
Warning:mssql_query () [function.mssql-query]: message:unclosed quotation mark before the character string ') '. (severity) in function.php on line 22
Warning:mssql_query () [Function.mssql-query]: Query failed in function.php on line 22
Baidu down, said is the problem of coding, but no matter I put function. PHP code to Utf-8 or gb2312 or report the same error, please friends to help you see
Reply to discussion (solution)
It's possible that your file has a BOM, take out the document BOM and try
Post your SQL instructions!
What is the document BOM on the 2 floor?
Post your SQL instructions!
$command =
"Select DISTINCT
Year (SJ) as Nian
From Dbo.table ";
$dataset =mssql_query ($command, $link);
This is obviously with the error message message:line 14:incorrect syntax near ' none '. (Severity 15) inconsistent
This is obviously with the error message message:line 14:incorrect syntax near ' none '. (Severity 15) inconsistent
Sorry, the wrong file is attached. That should be it.
function Add ($DJ, $SL, $SJ, $MC, $CTMC)
{
Include ". /connect.php ";
$command =
The INSERT into DBO.CANYINZC
(
Dj
Sl
Sj
Mc
Ctingmc
)
VALUES
(
$DJ,
$SL,
CONVERT (DATETIME, ' $SJ ', 102),
' $MC ',
' $CTMC '
)";
$dataset =mssql_query ($command, $link);
}
Echo $command;
See what it is?
Post your SQL instructions!
INSERT into DBO.CANYINZC (DJ, SL, SJ, MC, CTINGMC) VALUES (0, 0, CONVERT (DATETIME, ' 2014 qian? 0?? 0??, 102), ' None ', ' Juan ' ゼ coffin?? ')
The output of the SQL statement becomes garbled.
No environment can not be tested, it should be noted that:
1, MSSQL 2000 only support GBK, so you must use GBK encoding
2. If the field MC is of type nvarchar, the inserted data may need to make a type conversion declaration N ' None '
Other similar
3, MSSQL 2000 Escape special characters ' (single quote) when "(that is, two single quotes)