Is there PHP mysql_real_escape_string for postgresql?

前端 未结 4 826
我在风中等你
我在风中等你 2021-02-05 23:22

Is there PHP mysql_real_escape_string for postgresql? if yes then how ? please Give the Examples? & also the work of this string

4条回答
  •  心在旅途
    2021-02-05 23:45

    Alternatively you could use prepared statements (pg_prepare) and placeholders ($1, $2, etc), and then give the arguments for the query in pg_execute. This would be my preferred way as it's not only cleaner, but also safer in the long run since there's no chance for SQL injections if you always use placeholders in prepared statements.

提交回复
热议问题