On Tue, 2 Sep 2003 16:45:28 +0100, Craig Cameron wrote:
>
>Ok simple problem I hope.
>
>
>Have the following code, used to store the location and a few details about meeting
>minutes.
>
><snip>
> $connection = mssql_connect("server","user","password");
> mssql_select_db("DocumentManager",$connection);
>
> $AlteredMinutesLocation = str_replace("\\","\",$MinutesLocation);
>
> $SQL_STRING = "INSERT INTO tblMeetingMinutes
> VALUES('$Date','$Type','$AlteredMinutesLocation','$Centre')";
>
> $Result = mssql_query($SQL_STRING,$connection);
> mssql_close($connection);
>
></snip>
>
>Problem is the backslashes. When I collect the filepath ($Location) it puts \\ into
>the db. However, when I change this it stops dead. Basically due to the escape
>charateristics of the backslash. I can get around this with single quotes of course
>but can't put these in the SQL_STRING as it falls down there then!
>
>Somebody must have come across this before, any help much appreciated.
>
>Cheers
>
>Craig
>
Try using the built-in functions addslashes() and stripslashes().
Doug
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php