YW CHAN (Cai Lun e-Business) wrote:
> Gleb,
>
> Thanks, eventually I find that the problem is not the special.
>
> But the statement concat(field1,',',field2) as something will
> generate NULL if the field1 is NULL.
>
> Not sure if it's documented anywhere, or just a simple programming
> concept that null plus anything equal null..
Yes, that is documented. You can use concat_ws(',', field1, field2)
See: http://dev.mysql.com/doc/mysql/en/String_functions.html
HTH,
Wolfram
> ---------- Original Message ----------- From: Gleb Paharenko
> <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Mon, 13
> Dec 2004 13:44:42 +0200 Subject: Re: how escape special in a field
>
>
>> Hello.
>>
>> See:
>> http://dev.mysql.com/doc/mysql/en/mysql_real_escape_string.html
>>
>> Can you send complete test for your problem?
>>
>> "YW CHAN (Cai Lun e-Business)" <[EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>> I find there seems problem with this select statement when there
>>> is a special character inside the table. i.e.
>>>
>>> select concat(field_1, ',', field_2) as name where .......
>>>
>>> field_2 actually is something like 'George, Banson' ( with a
>>> comma in
>
> between )
>
>>> i guess this , destroy the SQL syntax.
>>>
>>> Is there any function for protecting this situation?
>>>
>>> Thanks for your help.
>>>
>>>
>>> Regards, CHAN
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]