Cooper94 Posted February 15, 2009 Share Posted February 15, 2009 It isnt showing all of the flights I have booked is there something I am doing wrong? <?php session_start(); include 'data.php'; $result = mysql_query("select * from book WHERE username = '{$_SESSION['username']}'"); $num = mysql_num_rows($result); $row = mysql_fetch_assoc($result); ?> <form action="http://www.republicv.org/site1/options.php?content=pirep" method="post"> <ul><li> If you would like to file a manual report please make sure the flight has been flown on vatsim or it will not be accepted. If you can not run our Acars System than you may contact the VP of Corparte Development at [email protected], and tell him the reason of this issue. Manual reports will be only accpeted as a last resort!</ul></li> <table width=100%> <tr><td colspan=2 align=center> <select name=flight onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option>No Booked Flights</option> <option><? echo $row['flightnum'] ?></option> </td></tr> Quote Link to comment https://forums.phpfreaks.com/topic/145300-option/ Share on other sites More sharing options...
cola Posted February 15, 2009 Share Posted February 15, 2009 try tihs <?php session_start(); include 'data.php'; $result = mysql_query("select * from book WHERE username = '{$_SESSION['username']}'"); $num = mysql_num_rows($result); ?> <form action="http://www.republicv.org/site1/options.php?content=pirep" method="post"> <ul><li> If you would like to file a manual report please make sure the flight has been flown on vatsim or it will not be accepted. If you can not run our Acars System than you may contact the VP of Corparte Development at [email protected], and tell him the reason of this issue. Manual reports will be only accpeted as a last resort!</ul></li> <table width=100%> <tr><td colspan=2 align=center> <select name=flight onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option>No Booked Flights</option> <option><? while ($row = mysql_fetch_array($result)) { echo $row['flightnum']; }?></option> </td></tr> Quote Link to comment https://forums.phpfreaks.com/topic/145300-option/#findComment-762769 Share on other sites More sharing options...
Cooper94 Posted February 15, 2009 Author Share Posted February 15, 2009 Yes this works but say I have two flights booked it wont create an option for the second one it just puts both the flights in one option tag. Quote Link to comment https://forums.phpfreaks.com/topic/145300-option/#findComment-762856 Share on other sites More sharing options...
.josh Posted February 15, 2009 Share Posted February 15, 2009 <?php while ($row = mysql_fetch_array($result)) { echo "<option value = '{$row['flightnum']}'>{$row['flightnum']}</option>"; } ?> </td></tr> Quote Link to comment https://forums.phpfreaks.com/topic/145300-option/#findComment-762863 Share on other sites More sharing options...
cola Posted February 15, 2009 Share Posted February 15, 2009 this is what u need. <?php session_start(); include 'data.php'; $result = mysql_query("select * from book WHERE username = '{$_SESSION['username']}'"); $num = mysql_num_rows($result); ?> <form action="http://www.republicv.org/site1/options.php?content=pirep" method="post"> <ul><li> If you would like to file a manual report please make sure the flight has been flown on vatsim or it will not be accepted. If you can not run our Acars System than you may contact the VP of Corparte Development at [email protected], and tell him the reason of this issue. Manual reports will be only accpeted as a last resort!</ul></li> <table width=100%> <tr><td colspan=2 align=center> <select name=flight onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option>No Booked Flights</option> <option><? while ($row = mysql_fetch_array($result)) { echo $row['flightnum']<?php session_start(); include 'data.php'; $result = mysql_query("select * from book WHERE username = '{$_SESSION['username']}'"); $num = mysql_num_rows($result); ?> <form action="http://www.republicv.org/site1/options.php?content=pirep" method="post"> <ul><li> If you would like to file a manual report please make sure the flight has been flown on vatsim or it will not be accepted. If you can not run our Acars System than you may contact the VP of Corparte Development at [email protected], and tell him the reason of this issue. Manual reports will be only accpeted as a last resort!</ul></li> <table width=100%> <tr><td colspan=2 align=center> <select name=flight onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option>No Booked Flights</option> <? while ($row = mysql_fetch_array($result)) { echo "!<option>".$row['flightnum']."</option>"; }?> Quote Link to comment https://forums.phpfreaks.com/topic/145300-option/#findComment-762869 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.