Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?
  2. $username="myacc";
  3. $password="mypw";
  4. $database="arr9gan7";
  5.  
  6. $name= $_GET["name"];
  7. $beruf= $_GET["beruf"];
  8. $votes= $_GET["votes"];
  9.  
  10. $g_link = mysql_connect('localhost', $username, $password) or die('Could not connect to mysql server.' );
  11. mysql_select_db($database, $g_link) or die('Could not select database.');
  12.  
  13. $query="SELECT * FROM statistik";
  14. $result=mysql_query($query);
  15. $num=mysql_numrows($result);
  16.  
  17. mysql_close();
  18.  
  19.  
  20. $i=0;
  21. while ($i < $num) {
  22.  
  23. $name=mysql_result($result,$i,"name");
  24. $votes=mysql_result($result,$i,"votes");
  25.  
  26. echo "<b><br>$name - $votes <br>";
  27.  
  28. $i++;
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement