Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. try {
  4.  
  5. $db = new PDO("mysql:host=localhost;dbname=ctnet_db", "ctnet_user", "yigit2606");
  6.  
  7. } catch (PDOException $e) {
  8.  
  9. print $e->getMessage();
  10.  
  11. }
  12.  
  13.  
  14.  
  15. $goster = $db->query("SELECT * FROM cointurk_index WHERE id='1'")->fetch(PDO::FETCH_ASSOC);
  16.  
  17.  
  18.  
  19.  
  20.  
  21. $indexnow = $goster[indexnow];
  22.  
  23. $indexlast = $goster[indexlast];
  24.  
  25.  
  26. echo '<div class="indexnow">';
  27. echo $indexnow;
  28. echo '</div>';
  29.  
  30.  
  31. echo "<br/>";
  32.  
  33. echo $indexlast;
  34.  
  35. echo "<br/>";
  36.  
  37. echo '<div class="durum">';
  38.  
  39. if ($indexnow > $indexlast){
  40.  
  41. echo "arti";
  42.  
  43. }else if ($indexnow < $indexlast){
  44.  
  45. echo "eksi";
  46.  
  47. }else if ($indexnow == $indexlast){
  48.  
  49. echo "sabit";
  50.  
  51. }
  52. echo '</div>';
  53.  
  54.  
  55.  
  56.  
  57.  
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement