Set format querystring

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
graz79
Forum Newbie
Posts: 4
Joined: Thu Aug 18, 2005 9:38 am
Location: Newcastle Upon Tyne, UK

Set format querystring

Post 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!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mysql_real_escape_string() or the equivalent in your DBMS would typically be used...
Post Reply