Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. $db = mysqli_connect("localhost","root","DevTest2","abc");
  3. $result = mysqli_query($db, "select * from url");
  4.  
  5. while ($row = mysqli_fetch_array($result))
  6. {
  7. /*$status = 0;
  8.  
  9. $time_start = microtime();
  10. file_get_contents($row['url']);
  11. $time_end = microtime();
  12.  
  13. $execution_time = ($time_end - $time_start/60);
  14.  
  15.  
  16. mysqli_query($db, "INSERT INTO `xrates` (`uid`, `xr`, `date`) VALUES ('".$row['id']."', //'".$execution_time."',NOW())");*/
  17.  
  18.  
  19. $json = "http://api.fixer.io/latest?base=ZAR&symbols=USD,EUR,GBP";
  20.  
  21.  
  22.  
  23. $jsonfile = file_get_contents($json);
  24.  
  25.  
  26.  
  27.  
  28. echo $str;
  29. mysqli_query($db, "INSERT INTO `xrates` (`uid`, `xr`, `date`) VALUES ('".$row['id']."', //'".$json."',NOW())");
  30.  
  31. }
  32. echo "done";
  33.  
  34. ?>
  35.  
  36.  
  37.  
  38. select * from json j
  39. inner join xrates x
  40. on j.id = x.uid
  41.  
  42. INSERT INTO ''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement