显示特定的行php

时间:2015-12-26 15:39:06

标签: javascript php

$arrayroom=array();  
$x1=0;
$qry1 = "SELECT * FROM reading_room ";
$room = mysql_query($qry1);
while($rowroom= mysql_fetch_array($room))
{
    $RRID=$rowroom['RRID'];
    $Section=$rowroom['Section'];
    $conflect=0;
    $qry2="SELECT * FROM reservation 
          WHERE RRID = $RRID 
          AND FromT= $new_start_date 
          AND EndT = $new_end_date ";
    $reservation = mysql_query($qry2);
    while($rowreservation = mysql_fetch_array($reservation))
    {
        $reserveSdate = $rowreservation['startdate'];
        $compare=$ReserveFrom_USER;
        if(($reserveSdate == $compare) && ($Tpart == $Tpart) )
        {$conflect = $conflect+1 ;}
        $compare = date('Y-m-d', strtotime($compare . ' + 1 day'));
    }
    if ( $conflect == 0 ) {
        $Secarray[$x1]= $Section;            
        $arrayroom[$x1]= $RRID;  
        $x1=$x1+1;
    }       
}
$arrlength=count($arrayroom);
if($arrlength!=0 ){
    echo "<h4  style=' font-size:22px; color:#f08b1f;'>: rooms available </h4>";
    print "<table class='Rtable'>";
    print "<tr><th>'  room number   '</th><th>'  section   '</th><th></th>";
    for($y=0;$y<$arrlength;$y++) 
    {
        echo '<tr><td>'.$arrayroom[$y].'</td>'; 
        echo '<td>'.$Secarray[$y].'</td>'; 
        echo '<td><input type="radio" name="NumRoom[]" value="'.$arrayroom[$y].'" />';
        echo'<tr>';
    }
    echo'</table>'; 
    echo "<br>";
    echo "<br>";
    echo "<input class='button1' type='submit' style='margin-right: 380px;' value='save'/>";
}

我想要显示与我选择的相同部分的房间,就像我选择男性部分显示给我时,只有男性部分可用的房间..

在上面,当我搜索显示所有可用的房间,如男性和女性..

我希望能找到答案。

谢谢

0 个答案:

没有答案