In article <aqb258$mdl$[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> > I am apparently unable to store new line (ASCII 13) character in varchar
> > (ASCII) from PHP (ODBC).
> >
> > I create the string like this:
> >
> > $newline=chr(13);
> > $result = "blah".$newline."huh";
> >
> > If I echo the $result, I see two lines of output:
> >
> > blah
> > huh
> >
> > After I insert this to SAP DB and retrive, echo the string, I get:
> >
> > blahhuh
> >
> > What happened to my new line?
>
> i have no problems using the Windows-ODBC-driver
> neither ASCII 10 nor ASCII 13 gets dropped.
>
> BTW: ACSII 13 is CarriageReturn ;-)
Thanks Sven,
yes, 13 is CR, 10 is LF.
In that case this is then a bug report. Here is a example code in PHP:
$conn= odbc_connect("mydns", "myusername", "mypassword");
#create table
$sql = "create table newline(testingfield varchar(100))";
#odbc_do($conn, $sql);
$sql = "delete from newline";
odbc_do($conn, $sql);
$newline=chr(13).chr(10);
$string="abcd".$newline."123";
echo $string;
#store a string
$sql = "insert into newline values ('".$string."')";
odbc_do($conn, $sql);
echo "\n\n\n<BR><BR><BR>\n\n\n";
#retrive stored string
$sql = "select * from newline";
$results=odbc_do($conn, $sql);
if ($results) {
while (odbc_fetch_into($results,$row)) {
echo $row[0];
}
}
================================== The output is :
abcd
123
<BR><BR><BR>
abcd 123
================================== It should be:
abcd
123
<BR><BR><BR>
abcd
123
----------------------------------
Linux RedHat 7.3, Php 4.1.2, unixODBC 2.0.5
SAP DB 7.3.0.23
Can anyone please confirm this?
Thank for your help,
--
Yours, Andrej Falout, http://www.falout.com/disclaimer.html
Visit the OpenSource alternative, Aubit 4gl: http://aubit4gl.sourceforge.net
PLEASE NOTE: All HTML email sent to me WILL BE DELETED AUTOMATICALLY WITHOUT
READING.
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general