masnobi Posted April 7, 2013 Share Posted April 7, 2013 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 Link to comment https://forums.phpfreaks.com/topic/276644-how-to-show-table-information-individually-in-php/ 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 Link to comment https://forums.phpfreaks.com/topic/276644-how-to-show-table-information-individually-in-php/#findComment-1424036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.