title: MySQL: Single qoute issue in passing parameter to a storedprocedure
body: <p>I am sending a comma separated list to my stored procedure from PHP. Stored procedure is like below: </p>
  
  <pre><code>UPDATE RolesMenus SET Enabled=1 WHERE MenuID IN(prmMenusList) AND RoleID = prmRoleID;
  </code></pre>
  
  <p>Now problem is that when I pass a list of menus(prmMenusList) through code it just updates the value of just first element in the list. This is, I think, due to some single quote around the list. Query may be formed like:</p>
  
  <pre><code>UPDATE RolesMenus SET Enabled=0 WHERE MenuID IN('1,7,19,20,21,26') AND RoleID = 74;
  </code></pre>
  
  <p>How can I avoid the situation? </p>
  
  <p>Here I have added the CodeIgniter(PHP) code:</p>
  
  <pre><code>Public function enableMenus($selectedMenus, $roleID){
                      $menusList = "";
                      foreach($selectedMenus as $item){
                          $menusList .= $item.",";
                      }
                      $menusList = substr($menusList, 0,strlen($menusList)-1); // to remove the leading comma
                      $result=$this-&gt;db-&gt;query("call uspEnableMenus('".$menusList."',".$roleID.")");
                      $tempResult = $result;
                      $result-&gt;next_result();
                      return $tempResult-&gt;result();
                  }
  </code></pre>