Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //GENERERA PLATSER
- $result = $con->query("SELECT `seat` FROM `user_book`");
- $seatsTaken = array();
- if( mysql_num_rows( $result ) > 0 )
- {
- while ( $row = mysql_fetch_assoc( $result ) )
- {
- $seatsTaken[] = $row['seat'];
- }
- }
- echo "<select name=\"seats\">";
- for ($i = 1; $i <= 124; $i++)
- {
- if( in_array($i, $seatsTaken ) )
- continue;
- echo "<option value=\"$i\">$i</option>";
- }
- echo "</select>";
Advertisement
Add Comment
Please, Sign In to add comment