title: how to enter double quotes in mysql database
body: <p>when ever I try to enter double quotes into the table, it shows some db error.
  I tried with stripslashes and <code>mysql_real_escape_string</code>, but it fails to enter into the table.</p>
  
  <p>Controller</p>
  
  <pre><code>function ConfirmOrder($arr) {
      $confirmation_number = substr(number_format(time() * rand(),0,'',''),0,10); 
      $ord_no = substr(number_format(time() * rand(),0,'',''),0,2); 
      $this-&gt;load-&gt;model('users_model');
      $this-&gt;users_model-&gt;ConfirmOrder($arr,$arr['order_id'],$confirmation_number,$ord_no);
      $confirm_status = array('status' =&gt; 'true', 'message' =&gt; 'Order Confirmed Successfully');
  
      echo json_encode($confirm_status);
  }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>function ConfirmOrder($arr,$order_id,$confirmation_no,$ord_no) {
      $data = array(
          'order_number'        =&gt; $ord_no.strtotime(date("Y-m-d H:i:s")),
          'order_date'          =&gt;  date("Y-m-d H:i:s"),
          'confirmation_number' =&gt;  $confirmation_no
      );
  
      $this-&gt;db-&gt;where('order_id',$order_id);
      $this-&gt;db-&gt;update('mun_order_master',$data);
  
      if($arr['my_picks']) {
          $pick_name =  mysql_real_escape_string($arr['pick_name']);
  
          $data1 = array(
              'user_id'   =&gt; $arr['user_id'],
              'order_id'  =&gt; $order_id,
              'pick_name' =&gt; $pick_name,
              'add_date'  =&gt;  date("Y-m-d H:i:s")
          );
  
          $this-&gt;db-&gt;insert('mun_my_picks', $data1);
          return $this-&gt;db-&gt;insert_id();
      }
  
      return true;
  }
  </code></pre>
  
  <p>The JSON I use</p>
  
  <pre><code>$json='{"function":"ConfirmOrder","parameters": "order_id": "7","user_id": "25","pick_name": "SPick","my_picks": "Y"},"token":""}'; 
  </code></pre>