blistovmhz

Untitled

Aug 1st, 2019
196
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <link rel="stylesheet" href="somecss.css">
  3. <body>
  4. <table border="1" cellpadding="5" cellspacing="1" width="1000" align="center">
  5.         <tr class="header">
  6.                 <th>CustomerID</th>
  7.                 <th>SystemID</th>
  8.                 <th>Lattitude</th>
  9.                 <th>Longitude</th>
  10.                 <th>Fix Type</th>
  11.                 <th>Satellites</th>
  12.                 <th>Altitude</th>
  13.                 <th>Time</th>
  14.         </tr
  15. <?php
  16.  
  17. $conn = pg_connect("host=localhost port=5432 dbname=shittyindex user=shittyuser password=shittypassword");
  18. $systems = pg_query($conn, "SELECT DISTINCT systemid FROM gpsdata WHERE customerid = 'somecustomer'");
  19. while ($row = pg_fetch_row($systems)){
  20.         $result = pg_query($conn, "SELECT * FROM gpsdata WHERE systemid = '$row[0]' AND (SELECT MAX (createdat) FROM gpsdata WHERE systemid = '$row[0]') = createdat");
  21.         while ($row = pg_fetch_row($result)){
  22.                 echo "<tr>";
  23.                 echo "<td>$row[0]</td>";
  24.                 echo "<td>$row[1]</td>";
  25.                 echo "<td>$row[2]</td>";
  26.                 echo "<td>$row[3]</td>";
  27.                 echo "<td>$row[4]</td>";
  28.                 echo "<td>$row[5]</td>";
  29.                 echo "<td>$row[6]</td>";
  30.                 echo "<td>$row[7]</td>";
  31.                 echo "</tr>";
  32.         }
  33. }
  34. ?>
  35. </table>
  36. </body>
  37. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×