Page 1 of 1

Set format querystring

Posted: Fri Sep 16, 2005 9:04 am
by graz79
I need a SQL query in the following format i.e. With the carriage returns within the query

Code: Select all

INSERT INTO myTable VALUES ('AT','00132183','','[Info]
NumAttachments=1
[Attachments]
			
Attachment1=test|\\clint\documents\heat attachments\September 05\00132183\call_raise.asp',DATEDIFF(ss,'01-01-1970',GETDATE()))
When I pass this through to the database it is removing the carriage returns.

I have tried to use the CHR(10) and CHR(13) charcters at both PHP and SQL levels.

The php is ignored by the time it gets to SQL. The SQL one inserts a non-printable character in the text field.

I need the SQL TEXT field3 to finish with the formatted text

Code: Select all

[Info]
NumAttachments=1
[Attachments]
			
Attachment1=test|\\clint\documents\heat attachments\September 05\00132183\call_raise.asp'
in it

PLEASE HELP!!

Posted: Fri Sep 16, 2005 10:07 am
by feyd
mysql_real_escape_string() or the equivalent in your DBMS would typically be used...