I am trying to use the addslashes() function and it is not working. I have a field that allows user input so they may use ' so I am trying to use addslashes and I get the following error:
Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near 't'. (severity 15) in c:\inetpub\wwwroot\niffer\NewTicket.php on line 129
Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark before the character string ' )'. (severity 15) in c:\inetpub\wwwroot\niffer\NewTicket.php on line 129
My code is:
$subject = addslashes($subject);
$comment = addslashes($comment);
$query = "INSERT INTO tblIssues
(IssueNumber,firstname,lastname,phone,email,issuetype,subject,comment,submittime,status)
VALUES('$MaxNumber','$firstname','$lastname','$phone','$email','$type','$subject','$comment','$time','$status' )";
$result = mssql_query($query) or die ("Query failed");
I get these errors when I use the work "can't" in the user field.
Can someone please give me suggestions.
Thanks,