Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2.  
  3. $host = "dbirkemalm.com.mysql";
  4. $username = "dbirkemalm_com";
  5. $password ="8ejxQ4Pn";
  6. $db_name = "dbirkemalm_com";
  7. $ip_table = 'ips';
  8. $vote_table = 'votes';
  9.  
  10.  
  11. $ip = $_SERVER['REMOTE_ADDR'];
  12. $vote = $_GET['id'];
  13.  
  14. mysql_connect("$host", "$username", "$password") or die ("cannot connect");
  15. mysql_select_db("$db_name") or die ("cannot select DB");
  16.  
  17. $iptestq = sprintf("SELECT * FROM $ip_table");
  18.  
  19. $result = mysql_query($iptestq);
  20.  
  21. if (!$result) {
  22.     echo "Could not successfully run query ($iptestq) from DB: " . mysql_error();
  23.     exit;
  24. }
  25.  
  26. if (mysql_num_rows($result)==0){
  27.     echo "No rows";
  28.     exit;
  29. }
  30.  
  31. while ($row = mysql_fetch_assoc($result)){
  32.     echo $row['$ip'];
  33. }
  34.  
  35. mysql_free_result($result);
  36.  
  37. //echo $_GET['id'];
  38.  
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement