having few issues getting nested loop work.
i building screen display users room types (from database) , set of tabs generated display rates linked each separate room type.
this part tabs:
$result = mysqli_query($con, "select * room_types session_id='$sessthis'"); while($row = mysqli_fetch_array($result)) { echo "<div role='tabpanel' class='tab-pane' id='" . $row['name'] . "_" . $row['tableid'] . "'>"; $get_data = mysqli_query($con, "select room_types.tableid, room_types.name, rates_1.rate_name, rates_1.rate_descr, rates_1.rate_monpr room_types inner join rates_1 on room_types.tableid=rates_1.room_type room_types.session_id='$sessthis' , rates_1.session_id='$sessthis' , rates_1.room_type=room_types.tableid"); while($row_rates = mysqli_fetch_array($get_data)) { echo "<div class='ui cards' style='width:100%'> <div class='card'> <div class='content'> <div class='header'>" . $row_rates['rate_name'] . "</div> <div class='meta'>" . $row_rates['name'] . "</div> <div class='description'> " . $row_rates['rate_descr'] . " </div> </div> </div> </div>"; } echo "</div>"; } what want open tab, loop through , display rates , close tab , loop through until rooms have been displayed. rates table has column called room_type store room type's tableid
what doing @ minute outputting correct number of tabs rates in every tab regardless of type. can point me in right direction ensuring, example, rates associated single room outputted tab single room?
many thanks.
edit: see post below, issue has been fixed.
i had brainwave, hit me when re-read question... sorry, friday afternoons! added variable outer loop defines room type id , added room_type=$type nested loop
Comments
Post a Comment