G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 6th, 2020 210 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <table border="1">
  2.     <tr>
  3.         <th>Номер потяга</th>
  4.         <th>Кількість вагонів</th>
  5.         <th>Станція відправлення</th>
  6.         <th>Станція прибуття</th>
  7.         <th>Дата та час відправлення</th>
  8.         <th>Дата та час прибуття</th>
  9.     </tr>
  10.     <?php
  11.     $db = mysqli_connect("localhost:3308", "root", "19801980", "mysitedb") or die(mysqli_error());
  12.     $rs = "SELECT train_number, carriage_count, s1.station_name AS departure, s2.station_name AS arriving,
  13.        departure_time, time_in_journey FROM main_table
  14.        JOIN stations_table s1 ON main_table.departure_point = s1.station_code
  15.        JOIN stations_table s2 ON main_table.arriving_point = s2.station_code;"; //запрос на выборку данных и выбраной таблицы
  16.     $result = $db->query($rs);
  17.  
  18.     if ($result->num_rows > 0) {
  19.         while ($row = $result->fetch_assoc()) {
  20.             echo "<tr><td>" . $row['train_number'] . "</td>
  21.            <td>" . $row['carriage_count'] . "</td>
  22.            <td>" . $row['departure'] . "</td>
  23.            <td>" . $row['arriving'] . "</td>
  24.            <td>" . $row['departure_time'] . "</td>
  25.            <td>" . $row['departure_time'] + $row['time_in_journey'] . "</td></tr>";
  26.         }
  27.         echo "</table>";
  28.     }
  29.     $db ->close();
  30.     ?>
  31. </table>
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top