Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <!doctype html>
  2. <html class="no-js" lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
  5. </head>
  6. <body>
  7. <?php
  8. //Connect To Database
  9. $hostname='37.187.141.39';
  10. $username='mc12';
  11. $password='6ece545c09';
  12. $dbname='mc12';
  13. $usertable='sl_creative';
  14. $yourfield = 'lat';
  15.  
  16. mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
  17. mysql_select_db($dbname);
  18.  
  19. $query = 'SELECT * FROM ' . $usertable;
  20. $result = mysql_query($query);
  21. if($result) {
  22. while($row = mysql_fetch_array($result)){
  23. print $name = $row[$yourfield];
  24. echo 'Name: ' . $name;
  25. }
  26. }
  27. else {
  28. print "Database NOT Found ";
  29. mysql_close($db_handle);
  30. }
  31.  
  32. ?>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement