title: Mysql select query with multiple id
body: <p>Well, I've a Mysql table(<strong>oc_calendar</strong>) like this:</p>
  
  <pre><code>id      start_date         username
  1       2013-04-04         18
  2       2013-03-31         19
  3       2013-04-04         19
  4       2013-04-02         19 
  5       2013-04-03         18
  </code></pre>
  
  <p>With following query I can get all id based on search result:</p>
  
  <pre><code>$search = mysql_query("SELECT DISTINCT username FROM oc_calendar WHERE start_date 
  between '$from' AND '$to'");
  
  while($re_search = mysql_fetch_array($search)) {
  
  $search_p_id = $re_search['username']; // here is the result Like: 18, 19 etc..
  }   
  </code></pre>
  
  <p>Now I'm trying to get another table(<strong>property_step1</strong>) information based on variable <strong>$search_p_id</strong> with following query but It's show error. May be my query is not correct.</p>
  
  <p><strong>Note: Variable $search_p_id can be 18 or 19, 18 etc..</strong></p>
  
  <pre><code>$search = mysql_query("SELECT * FROM property_step1 WHERE propertyid IN (" . 
  implode(',', $search_p_id) . ")"); 
  </code></pre>
  
  <p>Why it's show the error message, Any Idea ?</p>