Newline character in TEXT field.
am 02.12.2004 22:33:01 von KPennerI am trying to read in a text file and save it to a TEXT field in a MySQL database using perl 5.8. (DBI::MySQL). The file has CRLFs in it but when it is saved to the database is only has LFs.
I read in the file like this:
# Open input file of data
open( FILEIN, "$directory\\$fname" ) || die "can't open $fname $!";
undef $/;
$text =
close FILEIN;
My SQL statement is:
my $sth2 = $dbh->prepare( "Insert into reports
(type, ext, date, text, name, clientspec)
Values ( ?, ?, ?, ?, ?, ? )" );
and my execute statement is:
$sth3->execute( $type, $ext, $date, $text, $name, $clientspec, $name );
Is there some way to control what the newline character is when doing this?
ps. My co-worker is doing the same thing in PHP and is getting the full CRLF in the field.
Thanks,
Kevin M. Penner
Programmer
Call_Solutions
701-774-4021
"There are 10 types of people in the world,
those who know binary and those who don't."
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org