Thanks a lot Daniel,

But I'm wondering why the same thing works on a windows platform.

Uli St�rk

> -----Original Message-----
> From: Dittmar, Daniel [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 20, 2004 11:48 AM
> To: 'Ulrich St�rk'; [EMAIL PROTECTED]
> Subject: RE: Newlines
> 
> 
> > We run a PHP application which inserts freetext from a HTML 
> > textarea field into an ASCII varchar field in our database.
> > The PHP application puts the content of that textarea field 
> > in a query string and executes the query.
> 
> MaxDB does not support newlines in CHAR literals. Use 
> prepare/execute instead
> 
> // from 
> http://www.devshed.com/c/a/PHP/Database-Abstraction-With-PHP/6
/
// prepare query
$insert = $dbh->prepare("INSERT INTO tracks (cd, track) VALUES (12, ?)");

// execute insert
// run as many times as there are elements in $tracks
foreach($tracks as $t)
{
        $result = $dbh->execute($insert, $t);
}

If you pass the values as separate values to execute, then you don't have to worry 
about any special characters (except \0).

And it will be more efficient if you can keep $insert around instead of creating it 
for each set of input values.

Daniel Dittmar

-- 
Daniel Dittmar
SAP Labs Berlin
[EMAIL PROTECTED]


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to