masnobi Posted April 7, 2013 Share Posted April 7, 2013 (edited) Hi all, I am trying to show my table information individually, but I just cannot find the way of doing it. At the moment it looks like this- (pic1) I want it to show like this - (pic2) Here are my code <?php $depAirport=clean($_POST['depAirport']); $arrAirport=clean($_POST['arrAirport']); $dDate=clean($_POST['dDate']); $rDate=clean($_POST['rDate']); $adult=clean($_POST['adult']); $child=clean($_POST['child']); $infants=clean($_POST['infants']); $myList=clean($_POST['myList']); function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } $sql= "SELECT * from flight WHERE departure_airport ='$depAirport' AND arrival_airport = '$arrAirport' AND departure_date ='$dDate'"; $result = mysql_query($sql); echo "<table id='kool' border='1' cellpadding='2' summary='Table holds flight information'> <tr> <th>Flight No</th> <th>Departure Airport</th> <th>Arrival Airport</th> <th>Departure Date</th> <th>Arrival Date</th> <th>Flight Price</th> <th>Flight Duration</th> <th>Airline</th> </tr>"; while ($row = mysql_fetch_array($result)) {echo "<tr>"; echo "<td>" . $row['flight_no'] . "</td>"; echo "<td>" . $row['departure_airport'] . "</td>"; echo "<td>" . $row['arrival_airport'] . "</td>"; echo "<td>" . $row['departure_date'] . "</td>"; echo "<td>" . $row['arrival_date'] . "</td>"; echo "<td>" . '£' . $row['flight_price'] . "</td>"; echo "<td>" . $row['flight_duration'] . "</td>"; echo "<td>" . $row['flight_name'] . "</td>"; echo "</tr>"; } ?> <tr> <td colspan="18">Total fare per Adult is <?php echo '£' . 'flight_price'; ?> <input type="submit" name="Select Flight" id="submit" style="float:right" /> </td> </tr> </tfoot> </table> Please HELP Edited April 7, 2013 by masnobi Quote Link to comment Share on other sites More sharing options...
masnobi Posted April 11, 2013 Author Share Posted April 11, 2013 No one replied!!!!! Anyway, I have fixed it, so no worries Quote Link to comment 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.