<?php



//header('Access-Control-Allow-Origin: http://coopervision.com.tw');

header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');

header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');



$servername = "apps.webpuppies.com.sg";

$username = "webpuppi_master";

$password = "internal123";

$dbname = "webpuppi_cv";



// Create connection

$conn = new mysqli($servername, $username, $password, $dbname);

$conn->set_charset('utf8mb4');

// Check connection

if ($conn->connect_error) {

    die("Connection failed: " . $conn->connect_error);

} 



$sql = "SELECT * FROM twclariti_outlets";

$result = $conn->query($sql);

$json = array();



if ($result->num_rows > 0) {

    // output data of each row

    while($row = $result->fetch_assoc()) {

       $json[] = $row;

    }

    echo json_encode($json);

} else {

    echo "0 results";

}

$conn->close();