Well, I've a Mysql table(oc_calendar) like this:
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
With following query I can get all id based on search result:
$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..
}
Now I'm trying to get another table(property_step1) information based on variable $search_p_id with following query but It's show error. May be my query is not correct.
Note: Variable $search_p_id can be 18 or 19, 18 etc..
$search = mysql_query("SELECT * FROM property_step1 WHERE propertyid IN (" .
implode(',', $search_p_id) . ")");
Why it's show the error message, Any Idea ?