Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db_connection = pg_connect("host=localhost dbname=xxx user=xxx password=xxx");
- $result = pg_query($db_connection, "SELECT * FROM taxi_stats.satisfy");
- $data = array();
- while ($row = pg_fetch_array($result))
- {
- $data[] = $row;
- }
- echo json_encode($data);
- pg_close($db_connection);
- <script>
- d3.json("data.php", function(error, data) {
- if(error){
- console.log(error);
- }
- console.log(data);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement