Ok so i have an insert statement that is dynamically being generated via xml parser. The issue is that the data contains an ' in side of one of the fields. I am not sure that magic quotes will work for mssql as the \ does not escape in mssql. I could be wrong. But what are my options to resolve this issue. The insert works fine as long as the data does not have an ' in it.
Thanks
Dan
MSSQL insert statement
Moderator: General Moderators
-
kingconnections
- Forum Contributor
- Posts: 137
- Joined: Thu Jul 14, 2005 4:28 pm
-
kingconnections
- Forum Contributor
- Posts: 137
- Joined: Thu Jul 14, 2005 4:28 pm
[Solved]
Just an fyi for anyone who wants to know.
You can get around data that has an ' in it by doing a str_replace and replace the ' with '' in mssql.
example:
Thanks for the help guys.
You can get around data that has an ' in it by doing a str_replace and replace the ' with '' in mssql.
example:
Code: Select all
$description="$Update[Description]";
$description=str_replace("'","''",$description);Thanks for the help guys.