SHARE
TWEET

Untitled

a guest Mar 20th, 2017 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //Connect To Database
  3. $hostname='113.101.88.97.ukld.db.5513497.hostedresource.com';
  4. $username='myusername';
  5. $password='mypassword';
  6. $dbname='testdb';
  7. $usertable='test';
  8. $yourfield = 'lat';
  9.  
  10. mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
  11. mysql_select_db($dbname);
  12.  
  13. $query = 'SELECT * FROM ' . $usertable;
  14. $result = mysql_query($query);
  15. if($result) {
  16. while($row = mysql_fetch_array($result)){
  17. print $name = $row[$yourfield];
  18. echo 'Name: &#
  19. 39; . $name;
  20.     }
  21. }
  22. else {
  23. print "Database NOT Found ";
  24. mysql_close($db_handle);
  25. }
  26. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top