Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $servername = "156.17.130.204"; //replace it with your database server name
- $username = "root"; //replace it with your database username
- $password = "lato-2016!212"; //replace it with your database password
- $dbname = "zpi";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- $conn->set_charset('utf8');
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $query = "SELECT * FROM gallery";
- $result = mysqli_query($conn, $query);
- while($row = mysqli_fetch_assoc($result))
- {
- $data[] = $row;
- }
- header('Content-Type: application/json; Charset=UTF-8');
- echo (json_encode($data,JSON_UNESCAPED_UNICODE));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement