mysql_real_escape_string with Zend

前端 未结 4 894
遇见更好的自我
遇见更好的自我 2021-01-19 00:38

I am developing a web application using zend framework. For select statements I have used following way.

Ex:

public function getData($name)
{
  $sql          


        
4条回答
  •  旧时难觅i
    2021-01-19 01:12

    I had the same problem and this solution works fine for me. I hope this will help. you can do something like this:

    $quote_removed_name = str_replace("'","''",$name);
    

    then write your query this way:

    $sql = "SELECT * from customer where Customer_Name = '$quote_removed_name'";
    

提交回复
热议问题