avoiding MySQL injections with the Zend_Db class

后端 未结 7 2130
一生所求
一生所求 2020-12-02 21:31

I currently use Zend_Db to manage my queries. I\'ve written already code that preforms queries like the one below:

$handle->select()->from(\'user_id\')
              


        
7条回答
  •  借酒劲吻你
    2020-12-02 22:14

    by default when you use value binding in your SQL queries like this:

    where('first_name=?', $id);
    

    Zend_Db uses appropriate quoting of values to prevent SQL injection. although it is strongly recommended (by books, articles, manuals and self experience) to sanitize/filter user input. Zend_Filter can be very helpful.

提交回复
热议问题