Carriage Returns
am 06.11.2009 17:24:00 von Dan Shirah--0016e644cd9681110c0477b64539
Content-Type: text/plain; charset=ISO-8859-1
Hello all,
Basically I have a form with a
--0016e644cd9681110c0477b64539
Content-Type: text/plain; charset=ISO-8859-1
Hello all,
Basically I have a form with a
Are you using nl2br to convert before recording or after?
"Dan Shirah"
news:a16da1ff0911060824k779f7457wa1111fd6e8f4e419@mail.gmail .com...
> Hello all,
>
> Basically I have a form with a
My guess is that you are getting an SQL error returned to you. What does that
say? Is it talking about a broken SQL statement?
Also, an example of the actual insert statement with example data would be helpful.
Dan Shirah wrote:
> Hello all,
>
> Basically I have a form with a
--0016e6475b20cb4d8b0477b9b433
Content-Type: text/plain; charset=ISO-8859-1
>
> My guess is that you are getting an SQL error returned to you. What does
> that
> say? Is it talking about a broken SQL statement?
>
> Also, an example of the actual insert statement with example data would be
> helpful.
>
>
>
I'm getting the generic error message: Prepare fails (E [SQLSTATE=IX 000
SQLCODE=-282])
My insert statement when echo'd out using print_r($insert) is nothing
complex.
INSERT INTO my_table VALUES (0, 'This is my text. When I use carriage
returns it breaks. I am not sure why.')
--0016e6475b20cb4d8b0477b9b433--
Dan Shirah wrote:
> Hello all,
>
> Basically I have a form with a
On Sun, Nov 8, 2009 at 11:40 AM, John List
> Dan Shirah wrote:
>>
>> Hello all,
>>
>> Basically I have a form with a
Dan Shirah wrote:
>> My guess is that you are getting an SQL error returned to you. What does
>> that
>> say? Is it talking about a broken SQL statement?
>>
>> Also, an example of the actual insert statement with example data would be
>> helpful.
>>
>>
>>
>
> I'm getting the generic error message: Prepare fails (E [SQLSTATE=IX 000
> SQLCODE=-282])
>
> My insert statement when echo'd out using print_r($insert) is nothing
> complex.
>
> INSERT INTO my_table VALUES (0, 'This is my text. When I use carriage
> returns it breaks. I am not sure why.')
>
informix doesn't allow new lines in sql strings; unless you enable the
"ALLOW_NEWLINE" setting on the server.
to remove newlines I'd suggest stripping all vertical space and
replacing it with spaces, then stripping down the excess horizontal
space.. something like
function strip_newlines( $string ) {
$string = preg_replace( '/\v/' , ' ' , $string );
$string = preg_replace( '/\h\h+/' , ' ' , $string );
return $string;
}
$sql = strip_newlines( $sql );
regards,
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php