Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "x";
- $password = "x";
- $hostname = "x";
- //connection to the database
- $dbhandle = mysql_connect($hostname, $username, $password)
- or die("Unable to connect to MySQL");
- echo "Connected to MySQL<br>";
- //select a database to work with
- $selected = mysql_select_db("hw_terranova",$dbhandle)
- or die("Could not select database");
- //execute the SQL query and return records
- $result = mysql_query("SELECT coordinates FROM playermovement");
- //fetch tha data from the database
- while ($row = mysql_fetch_array($result)) {
- $coords = explode("," $row["coordinates"]);
- if (count($coords) == 3) echo trim($coords[0]). ",". trim($coords[2]) .", 1, 10/255 ". ;
- }
- //close the connection
- mysql_close($dbhandle);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement