$ymd=$_POST["borrowdated0"];
$ymd1=$_POST["borrowdated1"];
include "connect.php";
$sql5="select * from tb_rentwant WHERE idrentwant='$checkidbring[$i]' and status='1' and (($ymd BETWEEN rentdate and rentdated) or ($ymd1 BETWEEN rentdate and rentdated))";
$result5=mysql_db_query($dbname,$sql5);
$count=0;
while($record5=mysql_fetch_array($result5)) {
$count++;
echo"
<tr>
<td align='center'><span class='style1'>$count</span></td>
<td align='center'><span class='style1'>$record5[idrentwant]</span></td>
<td align='center'><span class='style1'>$record5[rentdate]</span></td>
<td align='center'><span class='style1'>$record5[rentdated]</span></td>";
}