mysql - PHP: two table in one query -
i have 2 different queries follows....
here list of network , buildging name.
network buildingname mass , mobile araneta mass , mobile home sweet hotels atrium hotels
example: in combobox network displayed there "mass , mobile" , "hotels"
after when choose mass , mobile
display "araneta"
, "home sweet"
checkbox. here program.
echo "<div><input type='checkbox' class='checkall'> check all</div>"; $section = mysql_query("select fldbldgname tblbuilding fldnetname = '$get_id' order fldbldgname"); while ($row = mysql_fetch_array($section)) { echo "<tr><td>"; echo "<div><input id='playbldg' type='checkbox' name='play[]' class='chk_boxes1' value='" . $row['fldbldgname']."'>"; echo $row['fldbldgname'];"</div>"; echo "</td></tr><br/>"; } echo "<br/>"; echo "<br/>"; echo "<input type='submit' name='save' value='add' onclick='checkfields()'>";
here code table...name tbldata[this field saving information]
example list in database tbldata
. can see have total duration field...
fldnetname fldbldgname fldtotalduration mass , mobile araneta 08:00:00 mass , mobile home sweet 00:25:00
in mass , mobile maximum total duration 08:00:00, can see building of araneta full home sweet not yet full....
i'm planning is, if building name of araneta full there no checkbox when less 08:00:00 checkbox appear....
example output want do:
araneta - 08:00:00
home sweet - 00:25:00
output: assuming "[]" checkbox
araneta [] home sweet [] sugar free [] google
how may achieve?
hope works you
echo "<div><input type='checkbox' class='checkall'> check all</div>"; $section = mysql_query("select fldbldgname,if(fldtotalduration<'08:00:00','show','notshow') status tblbuilding fldnetname = '$get_id' order fldbldgname"); while ($row = mysql_fetch_array($section)) { echo "<tr><td>"; if($row['status']=='show'){ echo "<div><input id='playbldg' type='checkbox' name='play[]' class='chk_boxes1' value='" . $row['fldbldgname']."'>"; } else{ echo "<div>"; } echo $row['fldbldgname'];"</div>"; echo "</td></tr><br/>"; } echo "<br/>"; echo "<br/>"; echo "<input type='submit' name='save' value='add' onclick='checkfields()'>";
Comments
Post a Comment