update.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. include "connect.php";
  3. date_default_timezone_set('America/New_York');
  4. header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
  5. header("Cache-Control: post-check=0, pre-check=0", false);
  6. header("Pragma: no-cache");
  7. $indextime = date("Y-m-d H:i:s");
  8. $sql = "SELECT * FROM coinlist";//desc LIMIT 1
  9. $result = $conn->query($sql);
  10. if ($result->num_rows > 0) {
  11. // output data of each row
  12. while($row = $result->fetch_assoc()) {
  13. $coinn = $row['name'];
  14. $coini = $row['slug'];
  15. $coins = $row['symbol'];
  16. $coinx = $row["exchange"];
  17. $coinc = $row["crawl"];
  18. // is the coin to be indexed?
  19. if ($coinc == 0) {
  20. // echo "$coinn ($coini $coinx) skipped\n";
  21. } else {
  22. // echo "Indexed: $coinn ($coini $coinx) $indextime\n";
  23. // sleep(2);
  24. exec('curl "http:/127.0.0.1/mdie/setsim.php?coin='.$coini.'"');
  25. // exec('curl "http://127.0.0.1/mdie/exchange.php?exchange='.$coinx.'&coin='.$coini.'&slug='.$coini.'"');
  26. }
  27. }
  28. } else {
  29. echo "NULL";
  30. }
  31. $conn->close();
  32. header("Location: ../index.php");
  33. ?>