Towards the end of me writing this I just spotted a major problem (it's only a tiny thing but it might solve your problems - read the bit in bold at the end first!)
I guess that all depends on how $days is formatted - when you say the user selects "days" - how are they selecting it - is it being returned as an array, class or text?
I think looking at it what your problem may be is the dbMarket->quote ( $days ) ; function as quote accepts a string and puts quotes round it - so with your code your in statement is going to look something like this
AND 'days' IN ('2,3,4,5')
which isn't exactly what you want you want...
AND 'days' in ('2', '3', '4', '5' )
so ideally something like
<?php
$dayArray = explode ( ',', $days ) ;
$dayIn = '' ;
foreach ( $dayArray as $day )
$dayIn .= $dbMarket->quote ( $day ) ;
...
'AND'. $dbMarket->quoteName('days') . " IN ( $dayIn )");
?>
Ideally you need to know what kind of data $days is holding - is it an array or is it text? You can do this by doing the following..
<?php
echo '<pre>'.print_r ( $days, true ).'</pre>' ;
?>
Also you could see what your IN statement is too by doing the following
<?php
echo '<pre>'.print_r ( 'AND'. $dbMarket->quoteName('days') . " IN (" . $dbMarket->quote($days) . ")");
?>
Also just noticed too - all your 'AND' statements need to have spaces either side (like with IN and between...
otherwise the SQL you are gettting is
WHERE startdate BETWEEN '$startdate'AND'$enddate'AND"marketname" = '$market'AND'days' IN '$days'
rather than
WHERE startdate BETWEEN '$startdate' AND '$enddate' AND "marketname" = '$market' AND 'days' IN '$days'
I think the first thing to try is putting spaces around the AND statements and that may fix your problem!