PDO插入语句和逗号分隔符

I have:

INSERT INTO post(title,message) VALUES (:title,:message) 

where :message value has some random text with symbols (including comma).

As the comma symbol is the separator between components of the statement:

How can i escape :message value to keep its included commas in the string context and not be interpreted as the separator?

You don't need to. The whole point of using prepared statements, as you are with PDO, is that the structure of the query is sent separately from the data. This means that characters in the data are never confused for parts of the structure of the query.

You've done all you need to do to make the query safe in this regard.

Prepared statements my friend.

This is what php.net has to say;

The query only needs to be parsed (or prepared) once, but can be executed multiple time with the same or different parameters. When the query is prepared, the database will analyze, compile and optimize its plan for executing the query. For complex queries this process can take up enough time that it will noticeably slow down an application if there is a need to repeat the same query many times with different parameters. By using a prepared statement the application avoids repeating the analyze/compile/optimize cycle. This means that prepared statements use fewer resources and thus run faster.

The parameters to prepared statements don't need to be quoted; the driver automatically handles this. If an application exclusively uses prepared statements, the developer can be sure that no SQL injection will occur (however, if other portions of the query are being built up with unescaped input, SQL injection is still possible).